30 lines
840 B
Plaintext
30 lines
840 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 primary_key: true}
|
|
{"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"
|
|
}
|