diff --git a/modules/sqlite_helpers.py b/modules/sqlite_helpers.py index d44b1ff..1cbd444 100644 --- a/modules/sqlite_helpers.py +++ b/modules/sqlite_helpers.py @@ -23,12 +23,19 @@ def maybe_create_table(sqlite_file: str) -> bool: used INTEGER DEFAULT 1, expires_at DATETIME DEFAULT NULL); """ - + create_pastes_table_query = """ + CREATE TABLE IF NOT EXISTS pastes ( + paste_id TEXT PRIMARY KEY, + title TEXT, + created_at DATETIME DEFAULT CURRENT_DATE, + deleted_at DATETIME DEFAULT NULL, + expires_at DATETIME DEFAULT NULL); + """ create_index_query = """ CREATE UNIQUE INDEX IF NOT EXISTS idx_urls_alias ON urls (alias); """ - + cursor.execute(create_pastes_table_query) cursor.execute(create_table_query) cursor.execute(create_index_query) db.commit()