-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmigrations.moon
More file actions
59 lines (52 loc) · 1.66 KB
/
Copy pathmigrations.moon
File metadata and controls
59 lines (52 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import create_table, types from require "lapis.db.schema"
{
-- table index is a unix timestamp, to keep track of table layout versions
[1451397695]: =>
create_table "users", {
{ "uuid", types.serial primary_key: true }
{ "username", types.varchar unique: true }
{ "password_hash", types.varchar }
{ "email", types.varchar unique: true }
}
[1451397696]: =>
create_table "groups", {
{ "gid", types.serial primary_key: true }
{ "groupname", types.varchar unique: true }
{ "permissions", types.integer } -- stored as a bitfield for now
}
[1451397697]: =>
create_table "user_group_pairs", {
{ "uuid", types.foreign_key }
{ "gid", types.foreign_key }
"PRIMARY KEY(uuid, gid)" -- pairwise primary key
}
[1451397698]: =>
create_table "profile_data", {
{ "uuid", types.foreign_key primary_key: true }
{ "gender", types.enum default: 0 }
{ "minecraft", types.varchar default: "" }
{ "steam", types.varchar default: "" }
{ "xbox", types.varchar default: "" }
{ "psn", types.varchar default: "" }
{ "wiiu", types.varchar default: "" }
{ "twitter", types.varchar default: "" }
{ "google", types.varchar default: "" }
{ "youtube", types.varchar default: "" }
}
[451509636]: =>
create_table "sessions", {
{ "sid", types.serial primary_key: true }
{ "uuid", types.foreign_key }
{ "hash", types.varchar }
{ "created_at", types.time }
{ "updated_at", types.time }
}
[1451509637]: =>
create_table "email_verifications", {
{ "evid", types.serial primary_key: true }
{ "email", types.varchar }
{ "hash", types.varchar }
{ "created_at", types.time }
{ "updated_at", types.time }
}
}