Actions
Defect #10431
closedPlugin cannot have more than single migration
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Invalid
Affected version:
Description
- Two years ago, I wrote the Redmine plugin.
- It modifies the
time_entries
table by adding two columns. - Now I need to add one more column.
- So I prepared another file in the
plugin/db/migrate
folder named20120312171801_add_abra_exported_flag.rb
which contains this:class TimeAddExportedToAbraField < ActiveRecord::Migration def self.up add_column :time_entries, :export_to_abra, :datetime, :null => true end def self.down remove_column :time_entries, :export_to_abra end end
- The older migrate file named
20100122233052_time_add_start_end_fields.rb
contains this:class TimeAddStartEndFields < ActiveRecord::Migration def self.up add_column :time_entries, :time_from, :time, :null => true add_column :time_entries, :time_to, :time, :null => true end def self.down remove_column :time_entries, :time_from remove_column :time_entries, :time_to end end
- When I do the
rake db:migrate_plugins --trace
, I will obrtain the following error which says nothing to me:(in /var/www/redmine) ** Invoke db:migrate_plugins (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate_plugins Migrating engines... Migrating acts_as_activity_provider... Migrating acts_as_attachable... Migrating acts_as_customizable... Migrating acts_as_event... Migrating acts_as_list... Migrating acts_as_searchable... Migrating acts_as_tree... Migrating acts_as_versioned... Migrating acts_as_watchable... Migrating awesome_nested_set... Migrating classic_pagination... Migrating gravatar... Migrating open_id_authentication... Migrating prepend_engine_views... Migrating redmine_kk_plans... Migrating redmine_kk_works... rake aborted! An error has occurred, all later migrations canceled: uninitialized constant AddAbraExportedFlag /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:469:in `load_missing_constant' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:106:in `const_missing' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:118:in `const_missing' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/inflector.rb:364:in `constantize' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/inflector.rb:363:in `each' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/inflector.rb:363:in `constantize' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/core_ext/string/inflections.rb:162:in `constantize' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:374:in `load_migration' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:369:in `migration' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:365:in `migrate' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:491:in `migrate' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:567:in `call' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:567:in `ddl_transaction' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:490:in `migrate' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:477:in `each' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:477:in `migrate' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:401:in `up' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:383:in `migrate' /var/www/redmine/vendor/plugins/engines/lib/engines/plugin/migrator.rb:20:in `migrate_plugin' /var/www/redmine/config/../vendor/plugins/engines/lib/engines/plugin.rb:93:in `migrate' /var/www/redmine/lib/tasks/migrate_plugins.rake:8 /var/www/redmine/lib/tasks/migrate_plugins.rake:5:in `each' /var/www/redmine/lib/tasks/migrate_plugins.rake:5 /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 /usr/bin/rake:19:in `load' /usr/bin/rake:19
- I spent many hours trying to figure out what to do to make this working.
- After all, I think it must be some sort of error...
- Please help me out of this...
Actions