raven/db/migrations/0004_add_license_comments_table.rb

21 lines
410 B
Ruby

Sequel.migration do
up do
create_table(:license_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(:license_comments) do
add_foreign_key :license_id, :licenses
end
end
down do
drop_table(:license_comments)
end
end