Doorkeeper: migration in 5.1

Created on 24 May 2017  路  6Comments  路  Source: doorkeeper-gem/doorkeeper

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 CreateDoorkeeperTables < ActiveRecord::Migration[4.2]

Most helpful comment

I fixed this for me by editing db/migrate/..._create_doorkeeper_tables.rb to have its first line be:

class CreateDoorkeeperTables < ActiveRecord::Migration[5.1]

The code generation probably wants to detect the Rails version and put it in?

All 6 comments

I fixed this for me by editing db/migrate/..._create_doorkeeper_tables.rb to have its first line be:

class CreateDoorkeeperTables < ActiveRecord::Migration[5.1]

The code generation probably wants to detect the Rails version and put it in?

@maclover7 I think we need to fix it for Rails >= 5.0. Different folders for different templates (aka "4.x" and "5.x) ? Or gsub_file to insert migration versions into templates if Rails version >= 5.0 (i think it is a preferable way)?

@nbulaj I correctly understood. You want to gsub in 'db/migrate/create_doorkeeper_tables.rb' version of migration?

@DmitryBash yep, it is a possible solution - gsub a migration from the generator (install action) by adding the version for later Rails.

Solved via #981.

Was this page helpful?
0 / 5 - 0 ratings