From c5cb9c93bb5f1d35f7a82d34ad0f21034221fcaa Mon Sep 17 00:00:00 2001 From: Tyler Hwang Date: Tue, 30 Jun 2026 20:44:17 -0700 Subject: [PATCH 1/2] Add pastes table --- modules/sqlite_helpers.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/sqlite_helpers.py b/modules/sqlite_helpers.py index 1cbd444..ff0f6a4 100644 --- a/modules/sqlite_helpers.py +++ b/modules/sqlite_helpers.py @@ -13,6 +13,15 @@ def maybe_create_table(sqlite_file: str) -> bool: db = sqlite3.connect(sqlite_file) cursor = db.cursor() +#new paste table +cursor.execute(""" + CREATE TABLE IF NOT EXISTS pastes ( + alias TEXT PRIMARY KEY, + title TEXT, + content TEXT NOT NULL + ) +""") + try: create_table_query = """ CREATE TABLE IF NOT EXISTS urls ( From b9ca486fbac86ee0bd4d20670235021632da3528 Mon Sep 17 00:00:00 2001 From: evan Date: Sat, 8 Aug 2026 16:47:50 -0700 Subject: [PATCH 2/2] paste_id becomes id --- modules/sqlite_helpers.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/modules/sqlite_helpers.py b/modules/sqlite_helpers.py index ff0f6a4..62a3b6f 100644 --- a/modules/sqlite_helpers.py +++ b/modules/sqlite_helpers.py @@ -13,15 +13,6 @@ def maybe_create_table(sqlite_file: str) -> bool: db = sqlite3.connect(sqlite_file) cursor = db.cursor() -#new paste table -cursor.execute(""" - CREATE TABLE IF NOT EXISTS pastes ( - alias TEXT PRIMARY KEY, - title TEXT, - content TEXT NOT NULL - ) -""") - try: create_table_query = """ CREATE TABLE IF NOT EXISTS urls ( @@ -34,7 +25,7 @@ def maybe_create_table(sqlite_file: str) -> bool: """ create_pastes_table_query = """ CREATE TABLE IF NOT EXISTS pastes ( - paste_id TEXT PRIMARY KEY, + id TEXT PRIMARY KEY, title TEXT, created_at DATETIME DEFAULT CURRENT_DATE, deleted_at DATETIME DEFAULT NULL,