mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-14 21:24:54 +08:00
12 lines
359 B
Ruby
12 lines
359 B
Ruby
|
class CreateSampleComments < ActiveRecord::Migration
|
||
|
def change
|
||
|
create_table :sample_comments do |t|
|
||
|
t.integer :sample_id, null: false
|
||
|
t.integer :comment_id, null: false
|
||
|
end
|
||
|
add_foreign_key :sample_comments, :samples
|
||
|
add_foreign_key :sample_comments, :comments
|
||
|
add_index :sample_comments, [:sample_id, :comment_id]
|
||
|
end
|
||
|
end
|