Actions
Defect #26610
closedMigration file generated by redmine_plugin_model generator is not compatible with Rails 5.1
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
Description
plugins/polls/db/migrate/001_create_polls.rb:
(generated by bin/rails generate redmine_plugin_model polls poll question:string yes:integer no:integer
)
class CreatePolls < ActiveRecord::Migration
def change
create_table :polls do |t|
t.string :question
t.integer :yes
t.integer :no
end
end
end
error:
$ bin/rails redmine:plugins:migrate Migrating polls (Polls plugin)... DEPRECATION WARNING: schema_migrations_table_name is deprecated and will be removed from Rails 5.2 (called from current_version at /Users/somebody/redmines/redmine-trunk/lib/redmine/plugin.rb:487) DEPRECATION WARNING: schema_migrations_table_name is deprecated and will be removed from Rails 5.2 (called from migrated at /Users/somebody/redmines/redmine-trunk/lib/redmine/plugin.rb:493) DEPRECATION WARNING: schema_migrations_table_name is deprecated and will be removed from Rails 5.2 (called from migrated at /Users/somebody/redmines/redmine-trunk/lib/redmine/plugin.rb:493) rails aborted! StandardError: An error has occurred, this and all later migrations canceled: Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for: class CreatePolls < ActiveRecord::Migration[4.2] /Users/somebody/redmines/gems/ruby/2.4.0/gems/activerecord-5.1.2/lib/active_record/migration.rb:525:in `inherited' /Users/somebody/redmines/redmine-trunk/plugins/polls/db/migrate/001_create_polls.rb:1:in `<top (required)
Related issues
Updated by Jean-Philippe Lang about 7 years ago
- Related to Feature #23630: Migrate to Rails 5.2 added
Updated by Jean-Philippe Lang about 7 years ago
- Status changed from New to Resolved
This should be fixed by r16945.
Updated by Go MAEDA about 7 years ago
Jean-Philippe Lang wrote:
This should be fixed by r16945.
Thanks, I confirmed that it has been fixed.
Updated by Jean-Philippe Lang about 6 years ago
- Status changed from Resolved to Closed
- Resolution set to Fixed
Thanks.
Actions