This repository has been archived on 2023-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
MirrorTea/mirrortea/repository/sqlite_init_tables.py

28 lines
671 B
Python
Raw Normal View History

TELEGRAM_USER_MATRIX_CHATS_SQL = """
CREATE TABLE IF NOT EXISTS telegram_user_matrix_chats (
id INTEGER PRIMARY KEY AUTOINCREMENT,
telegram_user_id INTEGER NOT NULL,
matrix_chat_id INTEGER NOT NULL,
FOREIGN KEY(telegram_user_id) REFERENCES telegram_users(id),
FOREIGN KEY(matrix_chat_id) REFERENCES matrix_chats(id)
);
"""
TELEGRAM_USERS_SQL = """
CREATE TABLE IF NOT EXISTS telegram_users
(
id INTEGER PRIMARY KEY NOT NULL (15),
first_name TEXT NOT NULL (50),
last_name TEXT (50),
username TEXT (50),
2023-01-10 00:48:55 +00:00
avatar_hash BLOB,
);
"""
MATRIX_ROOMS_SQL = """
CREATE TABLE IF NOT EXISTS telegram_users
(
id TEXT PRIMARY KEY NOT NULL
);
"""