24 lines
No EOL
617 B
Python
24 lines
No EOL
617 B
Python
# Migration for custom system messages
|
|
|
|
from datetime import datetime
|
|
|
|
def migration(conn):
|
|
with conn.cursor() as cursor:
|
|
cursor.execute(
|
|
"""
|
|
CREATE TABLE IF NOT EXISTS system_messages (
|
|
room_id TEXT NOT NULL,
|
|
message_id TEXT NOT NULL,
|
|
user_id TEXT NOT NULL,
|
|
body TEXT NOT NULL,
|
|
timestamp BIGINT NOT NULL,
|
|
)
|
|
"""
|
|
)
|
|
|
|
cursor.execute(
|
|
"INSERT INTO migrations (id, timestamp) VALUES (3, ?)",
|
|
(datetime.now(),)
|
|
)
|
|
|
|
conn.commit() |