34 lines
1.2 KiB
Python
34 lines
1.2 KiB
Python
|
|
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
|