2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-31 00:06:56 -04:00
|
|
|
class CreatePostDetails < ActiveRecord::Migration[4.2]
|
2013-10-15 10:21:30 -04:00
|
|
|
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, %i[post_id key], unique: true
|
|
|
|
end
|
|
|
|
end
|