class CreateUsers < ActiveRecord::Migration
  def change
    create_table :users do |t|

      t.string :name
      t.string :remember_token, index: true
      t.string :password_digest
      t.integer :level

      t.timestamps null: false
    end
  end
end

class CreateUsers < ActiveRecord::Migration[4.2]
  def change
    create_table :users do |t|

      t.string :name
      t.string :remember_token, index: true
      t.string :password_digest
      t.integer :level

      t.timestamps null: false
    end
  end
end

Fix migration for Rails 5
Fix migration for Rails 5

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