udemy-go-web-2/migrations/20210630180628_create_widgets_table.up.fizz

12 lines
402 B
Plaintext

create_table("widgets") {
t.Column("id", "integer", {primary: true})
t.Column("name", "string", {"default": ""})
t.Column("description", "text", {"default": ""})
t.Column("inventory_level", "integer", {})
t.Column("price", "integer", {})
}
sql("alter table widgets alter column created_at set default now();")
sql("alter table widgets alter column updated_at set default now();")