add telegram_users table
This commit is contained in:
parent
2ce7587d0a
commit
b5e57e80e9
1 changed files with 12 additions and 1 deletions
|
@ -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'],
|
||||||
|
|
Loading…
Reference in a new issue