DB Error during upgrade

View: New views
5 Messages — Rating Filter:   Alert me  

DB Error during upgrade

by dres1011 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I tested this going from 1.9 to 1.11.1 and it worked in my dev env.  Now that I have tried to migrate PRD, I get this error.  I'm totally hosed.

2009.10.29 10:36:44 ERROR rails  

StandardError (An error has occurred, all later migrations canceled:

ActiveRecord::ActiveRecordError: ORA-01430: column being added already exists in table
: ALTER TABLE rule_failures ADD line NUMBER(38)):
    /gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract_adapter.rb:188:in `log'
    /gems/gems/activerecord-jdbc-adapter-0.9/lib/active_record/connection_adapters/jdbc_adapter.rb:581:in `execute'
    /gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:195:in `add_column'
    /gems/gems/activerecord-2.2.2/lib/active_record/migration.rb:346:in `method_missing'
    /gems/gems/activerecord-2.2.2/lib/active_record/migration.rb:326:in `say_with_time'
    file:/lib/jruby-complete-1.3.1.jar!/benchmark.rb:293:in `measure'

Re: DB Error during upgrade

by dres1011 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I commented out the add column in the .rb migration file: war/sonar-web/WEB-INF/db/migrate/073_add_line_to_rule_failures.rb

The upgrade completed successfully.  I don't know why I had that column already.

class AddLineToRuleFailures < ActiveRecord::Migration

  def self.up
 #   add_column :rule_failures, :line, :integer, :null => true
    RuleFailure.reset_column_information
    migrate_data
  end

Re: DB Error during upgrade

by Olivier Gaudin-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

Are you sure that when you migrated your dev env, you were not pointing to the production DB ?

Olivier


On Thu, Oct 29, 2009 at 3:02 PM, dres1011 <me@...> wrote:

I commented out the add column in the .rb migration file:
war/sonar-web/WEB-INF/db/migrate/073_add_line_to_rule_failures.rb

The upgrade completed successfully.  I don't know why I had that column
already.

class AddLineToRuleFailures < ActiveRecord::Migration

 def self.up
 #   add_column :rule_failures, :line, :integer, :null => true
   RuleFailure.reset_column_information
   migrate_data
 end
--
View this message in context: http://www.nabble.com/DB-Error-during-upgrade-tp26117665p26118909.html
Sent from the Sonar user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




Re: DB Error during upgrade

by dres1011 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That's a good point but yes, i'm sure.  Since by commenting out that line, I was able to proceed.  I can clearly see that dev is dev data and Prd is prd.

Any chance that migration could get run twice during the same upgrade?  I swear I didn't hit the upgrade button twice.

Olivier Gaudin-2 wrote:
Hello,

Are you sure that when you migrated your dev env, you were not pointing to
the production DB ?

Olivier

Re: DB Error during upgrade

by Olivier Gaudin-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That indeed the other option. If somebody has hit the server whilst you were upgrading, it could have messed up the setup

Olivier



On Fri, Oct 30, 2009 at 11:49 AM, dres1011 <me@...> wrote:

That's a good point but yes, i'm sure.  Since by commenting out that line, I
was able to proceed.  I can clearly see that dev is dev data and Prd is prd.

Any chance that migration could get run twice during the same upgrade?  I
swear I didn't hit the upgrade button twice.


Olivier Gaudin-2 wrote:
>
> Hello,
>
> Are you sure that when you migrated your dev env, you were not pointing to
> the production DB ?
>
> Olivier
>
>
--
View this message in context: http://old.nabble.com/DB-Error-during-upgrade-tp26117665p26132428.html
Sent from the Sonar user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email