12 lines
562 B
Plaintext
12 lines
562 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();")
|
|
|
|
sql("insert into widgets (name, description, inventory_level, price, created_at, updated_at) values ('Widget', 'A very nice widget.', 10, 1000, now(), now());") |