-
Notifications
You must be signed in to change notification settings - Fork 2
/
migrations.py
53 lines (51 loc) · 1.33 KB
/
migrations.py
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
async def m001_initial(db):
"""
Initial schedules table.
"""
await db.execute(
f"""
CREATE TABLE lncalendar.schedule (
id TEXT PRIMARY KEY,
wallet TEXT NOT NULL,
name TEXT NOT NULL,
start_day INTEGER NOT NULL,
end_day INTEGER NOT NULL,
start_time TEXT NOT NULL,
end_time TEXT NOT NULL,
amount {db.big_int} NOT NULL
);
"""
)
"""
Initial unavailability table.
This is used for the user to set unavailable times.
"""
await db.execute(
f"""
CREATE TABLE lncalendar.unavailable (
id TEXT PRIMARY KEY,
start_time TEXT NOT NULL,
end_time TEXT NOT NULL,
schedule TEXT NOT NULL,
time TIMESTAMP NOT NULL DEFAULT {db.timestamp_now}
);
"""
)
"""
Initial appointments table.
"""
await db.execute(
f"""
CREATE TABLE lncalendar.appointment (
id TEXT PRIMARY KEY,
name TEXT NOT NULL,
email TEXT,
info TEXT,
start_time TEXT NOT NULL,
end_time TEXT NOT NULL,
schedule TEXT NOT NULL,
paid BOOLEAN DEFAULT false,
time TIMESTAMP NOT NULL DEFAULT {db.timestamp_now}
);
"""
)