Skip to content

Instantly share code, notes, and snippets.

@123ish
Created June 27, 2020 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 123ish/f3aed9050da01464490352b18cb0d543 to your computer and use it in GitHub Desktop.
Save 123ish/f3aed9050da01464490352b18cb0d543 to your computer and use it in GitHub Desktop.
friendly id #db/migrate/date_add_slug_to_entries.rb
class AddSlugToEntries < ActiveRecord::Migration[5.2]
def change
add_column :entries, :slug, :string
add_index :entries, :slug, unique: true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment