simplex2/migrations.moon
2018-03-16 17:07:31 -07:00

30 lines
822 B
Plaintext

import create_table, types, create_index from require "lapis.db.schema"
import make_migrations, autoload from require "locator"
import settings from autoload "utility"
make_migrations {
[1520941132]: =>
create_table "tasks", {
{"id", types.serial primary_key: true}
{"user_id", types.foreign_key}
{"text", types.text}
{"done", types.boolean default: false}
{"created_at", types.time}
{"updated_at", types.time}
}
create_table "keys", {
{"user_id", types.foreign_key}
{"uuid", types.varchar unique: true}
{"created_at", types.time}
{"updated_at", types.time}
}
create_index "keys", "user_id"
create_index "keys", "uuid"
create_index "tasks", "id"
create_index "tasks", "user_id"
create_index "tasks", "user_id", "done"
}