Redmine with Rails 5 Compatibility Issues

Error:


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

  class CreateSptimes < ActiveRecord::Migration[4.2]
D:/Dhinesh/Redmine/v2/redmine-4.1.1/plugins/redmine_spent_time/db/migrate/001_create_sptimes.rb:1:in `<top (required)>'
D:/Dhinesh/Redmine/v2/redmine-4.1.1/lib/redmine/plugin.rb:510:in `up'
D:/Dhinesh/Redmine/v2/redmine-4.1.1/lib/redmine/plugin.rb:542:in `migrate_plugin'
D:/Dhinesh/Redmine/v2/redmine-4.1.1/lib/redmine/plugin.rb:483:in `migrate'
D:/Dhinesh/Redmine/v2/redmine-4.1.1/lib/redmine/plugin.rb:497:in `block in migrate'
D:/Dhinesh/Redmine/v2/redmine-4.1.1/lib/redmine/plugin.rb:496:in `each'
D:/Dhinesh/Redmine/v2/redmine-4.1.1/lib/redmine/plugin.rb:496:in `migrate'
D:/Dhinesh/Redmine/v2/redmine-4.1.1/lib/tasks/redmine.rake:135:in `block (3 levels) in <top (required)>'


Solution: 

You have to specify the version in brackets like it says. Have you added any migrations since upgrading?

Example change from:

class CreateSptimes < ActiveRecord::Migration

to

class CreateSptimes < ActiveRecord::Migration[5.2]

You can add the version to all migrations by running this:

grep -rl ActiveRecord::Migration$ db | xargs sed -i "" "s/ActiveRecord::Migration/ActiveRecord::Migration[5.1]/g"

Comments

Popular posts from this blog

Redmine - Spent Time Installation

Redmine Compatibility Issues Before_filter