From c34d75a29b7d144030542b9de4fd0e0d614303a9 Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Tue, 3 Sep 2024 11:08:31 +0300 Subject: Use Jsonb for storing results. --- gn3/api/llm.py | 2 +- sql/update/llm_db_tables.sql | 2 +- sql/update/llm_db_update.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gn3/api/llm.py b/gn3/api/llm.py index 8d17bc2..9ee4a79 100644 --- a/gn3/api/llm.py +++ b/gn3/api/llm.py @@ -40,7 +40,7 @@ def search(): history(user_id TEXT NOT NULL, task_id TEXT NOT NULL, query TEXT NOT NULL, - results TEXT, + results JSONB, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY(task_id)) WITHOUT ROWID""") cursor.execute( diff --git a/sql/update/llm_db_tables.sql b/sql/update/llm_db_tables.sql index a6c0479..b501832 100644 --- a/sql/update/llm_db_tables.sql +++ b/sql/update/llm_db_tables.sql @@ -26,7 +26,7 @@ CREATE TABLE IF NOT EXISTS history ( user_id TEXT NOT NULL, task_id TEXT NOT NULL, query TEXT NOT NULL, - results TEXT, + results JSONB, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (task_id) ) WITHOUT ROWID; diff --git a/sql/update/llm_db_update.sql b/sql/update/llm_db_update.sql index a4eb848..7f1a9f9 100644 --- a/sql/update/llm_db_update.sql +++ b/sql/update/llm_db_update.sql @@ -25,7 +25,7 @@ CREATE TABLE IF NOT EXISTS history ( user_id TEXT NOT NULL, task_id TEXT NOT NULL, query TEXT NOT NULL, - results TEXT, + results JSONB, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (task_id) ) WITHOUT ROWID; -- cgit v1.2.3