scinote-web/db/migrate/20151119141714_create_asset_text_data.rb

12 lines
333 B
Ruby
Raw Normal View History

2017-06-30 16:23:28 +08:00
class CreateAssetTextData < ActiveRecord::Migration[4.2]
2016-02-12 23:52:43 +08:00
def change
create_table :asset_text_data do |t|
t.text :data, null: false
2017-06-30 16:23:28 +08:00
t.integer :asset_id, null: false
2016-02-12 23:52:43 +08:00
t.timestamps null: false
end
add_foreign_key :asset_text_data, :assets
add_index :asset_text_data, :asset_id, unique: true
end
end