Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot be used in version 4.0.4 #25

Open
smashdog opened this issue Jun 21, 2019 · 1 comment
Open

Cannot be used in version 4.0.4 #25

smashdog opened this issue Jun 21, 2019 · 1 comment

Comments

@smashdog
Copy link

`rake redmine:plugins:migrate RAILS_ENV=production NAME=redmine_category_tree
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:

class IssueCategoryActsAsNestedSet < ActiveRecord::Migration[4.2]
/var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:528:in inherited' /mnt/d/code/ruby/redmine-4.0.4/plugins/redmine_category_tree/db/migrate/001_issue_category_acts_as_nested_set.rb:1:in <top (required)>'
/var/lib/gems/2.6.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in require' /var/lib/gems/2.6.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in require'
/var/lib/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in block in require' /var/lib/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in load_dependency'
/var/lib/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in require' /var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:986:in load_migration'
/var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:982:in migration' /var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:977:in disable_ddl_transaction'
/var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1350:in use_transaction?' /var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1342:in ddl_transaction'
/var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1291:in execute_migration_in_transaction' /var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1263:in block in migrate_without_lock'
/var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in each' /var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in migrate_without_lock'
/var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in block in migrate' /var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1363:in with_advisory_lock'
/var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in migrate' /mnt/d/code/ruby/redmine-4.0.4/lib/redmine/plugin.rb:504:in up'
/var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1011:in migrate' /mnt/d/code/ruby/redmine-4.0.4/lib/redmine/plugin.rb:536:in migrate_plugin'
/mnt/d/code/ruby/redmine-4.0.4/lib/redmine/plugin.rb:477:in migrate' /mnt/d/code/ruby/redmine-4.0.4/lib/redmine/plugin.rb:488:in migrate'
/mnt/d/code/ruby/redmine-4.0.4/lib/tasks/redmine.rake:135:in block (3 levels) in <top (required)>' /var/lib/gems/2.6.0/gems/rake-12.3.2/exe/rake:27:in <top (required)>'

Caused by:
StandardError: Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:

class IssueCategoryActsAsNestedSet < ActiveRecord::Migration[4.2]
/var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:528:in inherited' /mnt/d/code/ruby/redmine-4.0.4/plugins/redmine_category_tree/db/migrate/001_issue_category_acts_as_nested_set.rb:1:in <top (required)>'
/var/lib/gems/2.6.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in require' /var/lib/gems/2.6.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in require'
/var/lib/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in block in require' /var/lib/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in load_dependency'
/var/lib/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in require' /var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:986:in load_migration'
/var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:982:in migration' /var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:977:in disable_ddl_transaction'
/var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1350:in use_transaction?' /var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1342:in ddl_transaction'
/var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1291:in execute_migration_in_transaction' /var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1263:in block in migrate_without_lock'
/var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in each' /var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in migrate_without_lock'
/var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in block in migrate' /var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1363:in with_advisory_lock'
/var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in migrate' /mnt/d/code/ruby/redmine-4.0.4/lib/redmine/plugin.rb:504:in up'
/var/lib/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1011:in migrate' /mnt/d/code/ruby/redmine-4.0.4/lib/redmine/plugin.rb:536:in migrate_plugin'
/mnt/d/code/ruby/redmine-4.0.4/lib/redmine/plugin.rb:477:in migrate' /mnt/d/code/ruby/redmine-4.0.4/lib/redmine/plugin.rb:488:in migrate'
/mnt/d/code/ruby/redmine-4.0.4/lib/tasks/redmine.rake:135:in block (3 levels) in <top (required)>' /var/lib/gems/2.6.0/gems/rake-12.3.2/exe/rake:27:in <top (required)>'
Tasks: TOP => redmine:plugins:migrate
(See full trace by running task with --trace)
`

@edotlitw
Copy link

edotlitw commented Jan 6, 2021

Found a solution here...

modify

  • db/migrate/001_issue_category_acts_as_nested_set.rb line#1

from
class IssueCategoryActsAsNestedSet < ActiveRecord::Migration
to
class IssueCategoryActsAsNestedSet < ActiveRecord::Migration[5.2]

  • db/migrate/002_fix_defaut_value_for_lft_and_rgt_columns.rb line#1

from
class FixDefautValueForLftAndRgtColumns < ActiveRecord::Migration
to
class FixDefautValueForLftAndRgtColumns < ActiveRecord::Migration[5.2]

works for me with Redmine 4.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants