2013-10-15 10:21:30 -04:00
|
|
|
class CreatePostDetails < ActiveRecord::Migration
|
|
|
|
def change
|
|
|
|
create_table :post_details do |t|
|
|
|
|
t.belongs_to :post
|
|
|
|
t.string :key
|
|
|
|
t.string :value, size: 512
|
|
|
|
t.text :extra
|
|
|
|
|
2017-08-07 11:48:36 -04:00
|
|
|
t.timestamps null: false
|
2013-10-15 10:21:30 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index :post_details, [:post_id, :key], unique: true
|
|
|
|
end
|
|
|
|
end
|