class CreatePosts::V00000000000003 < Avram::Migrator::Migration::V1 def migrate create table_for(Post) do primary_key id : Int64 add file_url : String, unique: true add title : String?, default: nil add description : String?, default: nil add_belongs_to creator : User?, on_delete: :restrict add_timestamps add score : Int64, default: 0 add views : Int64, default: 0 # NOTE: Should really be UInt64 add favourites : Int64, default: 0 # NOTE: Should really be UInt64 add file_size : Int64 end end def rollback drop table_for(Post) end end