Rake Migration Error


That's error like that.

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 CreateFriendlyIdSlugs < ActiveRecord::Migration[4.2]
 That problem due to rails version. So all you need to do, enter db>migrate folder and opened YOURDATE_create_friendly_id_slugs.rb file. Then add extend class name [5.1].



     class CreateFriendlyIdSlugs < ActiveRecord::Migration[5.1]

  def change    create_table :friendly_id_slugs do |t|
      t.string   :slug,           :null => false

      t.integer  :sluggable_id,   :null => false

      t.string   :sluggable_type, :limit => 50

      t.string   :scope

      t.datetime :created_at    end    add_index :friendly_id_slugs, :sluggable_id

    add_index :friendly_id_slugs, [:slug, :sluggable_type]

    add_index :friendly_id_slugs, [:slug, :sluggable_type, :scope], :unique => true

    add_index :friendly_id_slugs, :sluggable_type

  endend


end
end

It looks like

Yorumlar

Bu blogdaki popüler yayınlar