server WIP
This commit is contained in:
parent
7d00923533
commit
7622cc99ca
6 changed files with 198 additions and 10 deletions
34
migrations/0.py
Normal file
34
migrations/0.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
|
||||
async def migrate(conn):
|
||||
await conn.execute('''CREATE TABLE IF NOT EXISTS messages (
|
||||
message TEXT,
|
||||
suppress_display INTEGER,
|
||||
moderated INTEGER,
|
||||
remote_ip TEXT,
|
||||
timestamp_received TEXT DEFAULT (datetime('now')),
|
||||
timestamp_displayed TEXT DEFAULT NULL
|
||||
)''')
|
||||
|
||||
await conn.execute('''CREATE TABLE IF NOT EXISTS shitlist (
|
||||
remote_ip TEXT,
|
||||
reason TEXT,
|
||||
timestamp_added TEXT DEFAULT (datetime('now'))
|
||||
)''')
|
||||
|
||||
await conn.execute('''CREATE TABLE IF NOT EXISTS suslist (
|
||||
remote_ip TEXT,
|
||||
reason TEXT,
|
||||
timestamp_added TEXT DEFAULT (datetime('now'))
|
||||
)''')
|
||||
|
||||
await conn.execute('''CREATE TABLE IF NOT EXISTS badwords (
|
||||
word TEXT,
|
||||
reason TEXT,
|
||||
timestamp_added TEXT DEFAULT (datetime('now'))
|
||||
)''')
|
||||
|
||||
await conn.execute('''INSERT INTO badwords (word, reason) VALUES ("bitcoin", "cryptocurrency")''')
|
||||
|
||||
|
||||
async def valid_migration(conn):
|
||||
return True
|
||||
Loading…
Add table
Add a link
Reference in a new issue