21 lines
395 B
Ruby
21 lines
395 B
Ruby
Sequel.migration do
|
|
|
|
up do
|
|
create_table(:item_comments) do
|
|
primary_key :id
|
|
String :body, null: false
|
|
DateTime :created_at, default: Sequel::CURRENT_TIMESTAMP
|
|
DateTime :updated_at, default: Sequel::CURRENT_TIMESTAMP
|
|
end
|
|
|
|
alter_table(:item_comments) do
|
|
add_foreign_key :item_id, :items
|
|
end
|
|
end
|
|
|
|
down do
|
|
drop_table(:item_comments)
|
|
end
|
|
|
|
end
|