Class: CreateTags
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateTags
- Defined in:
- lib/ecrire/db/migrate/20150318549479_create_tags.rb
Instance Method Summary collapse
Instance Method Details
#change ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 |
# File 'lib/ecrire/db/migrate/20150318549479_create_tags.rb', line 2 def change create_table :tags do |t| t.string :name, null: false t. null: false end add_index :tags, :name, unique: true add_column :posts, :tags, :integer, array: true, defaut: [] end |