Class: CreateSlugs
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateSlugs
- Defined in:
- lib/generators/slugs/install/templates/migration.rb
Instance Method Summary collapse
Instance Method Details
#change ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/generators/slugs/install/templates/migration.rb', line 2 def change create_table :slugs do |t| t.integer :sluggable_id t.string :sluggable_type t.string :value t. null: false end add_index :slugs, :sluggable_id add_index :slugs, :sluggable_type add_index :slugs, :value end |