-
Notifications
You must be signed in to change notification settings - Fork 0
/
migrations.py
37 lines (35 loc) · 966 Bytes
/
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
async def m001_add_coinflip_settings(db):
"""
Creates a hash check table.
"""
await db.execute(
"""
CREATE TABLE coinflip.settings (
id TEXT PRIMARY KEY,
wallet_id TEXT NOT NULL,
user_id TEXT NOT NULL,
haircut INTEGER NOT NULL,
max_players INTEGER NOT NULL,
max_bet INTEGER NOT NULL,
enabled BOOLEAN NOT NULL
);
"""
)
async def m002_add_coinflip(db):
"""
Creates a hash check table.
"""
await db.execute(
f"""
CREATE TABLE coinflip.coinflip (
id TEXT PRIMARY KEY,
settings_id TEXT NOT NULL,
name TEXT NOT NULL,
number_of_players INTEGER NOT NULL,
buy_in INTEGER NOT NULL,
players TEXT NOT NULL,
completed BOOLEAN,
created_at TIMESTAMP NOT NULL DEFAULT {db.timestamp_now}
);
"""
)