wikicr/db/migrations/20211014221710_create_page_revisions.cr
Arthur Poulet e9bb1cbdc0
Some checks failed
continuous-integration/drone/push Build is failing
spike: try to install & migrate to lucky
2021-10-15 18:44:23 +02:00

18 lines
547 B
Crystal

class CreatePageRevisions::V20211014221710 < Avram::Migrator::Migration::V1
def migrate
# Learn about migrations at: https://luckyframework.org/guides/database/migrations
create table_for(PageRevisions) do
primary_key id : Int64
add_timestamps
add_belongs_to page : Page, on_delete: :cascade, foreign_key_type: UUID
add_belongs_to user : User, on_delete: :cascade, foreign_key_type: Int64
add commit : String
add body : String
end
end
def rollback
drop table_for(PageRevisions)
end
end