1
0
Fork 0

add telegram_users table

This commit is contained in:
def 2023-01-09 01:13:27 +03:00
parent 2ce7587d0a
commit b5e57e80e9

View file

@ -13,9 +13,20 @@ CREATE TABLE IF NOT EXISTS telegram_user_matrix_chats (
matrix_chat_id INTEGER NOT NULL, matrix_chat_id INTEGER NOT NULL,
FOREIGN KEY(telegram_user_id) REFERENCES telegram_users(id), FOREIGN KEY(telegram_user_id) REFERENCES telegram_users(id),
FOREIGN KEY(matrix_chat_id) REFERENCES matrix_chats(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 CHECK(id < 15),
first_name TEXT NOT NULL CHECK(first_name < 50),
last_name TEXT CHECK(last_name < 50,
username TEXT CHECK(username < 50),
);
'''
def main(): def main():
config = Config( config = Config(
db_path=os.environ['DB_PATH'], db_path=os.environ['DB_PATH'],