aboutsummaryrefslogtreecommitdiff
path: root/gn3
diff options
context:
space:
mode:
authorAlexander_Kabui2024-08-29 11:05:39 +0300
committerAlexander_Kabui2024-08-29 11:05:39 +0300
commita45ab3e62df6e1dfcc6fff03916369fbdaf68ab8 (patch)
tree752d1155cef35e3ba058fb991542e09659ff733e /gn3
parent7b17ab9d98f6a12f2a5b9b0eec8ff4c2c3ef2a5e (diff)
downloadgenenetwork3-a45ab3e62df6e1dfcc6fff03916369fbdaf68ab8.tar.gz
Add default timestamp and and primary key for Rating table.
Diffstat (limited to 'gn3')
-rw-r--r--gn3/api/llm.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gn3/api/llm.py b/gn3/api/llm.py
index 5901ef5..952a5b9 100644
--- a/gn3/api/llm.py
+++ b/gn3/api/llm.py
@@ -71,8 +71,8 @@ def rate_queries(task_id):
answer TEXT NOT NULL,
weight INTEGER NOT NULL DEFAULT 0,
task_id TEXT NOT NULL UNIQUE,
- created_at TIMESTAMP
- )"""
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY(task_id))"""
cursor.execute(create_table)
cursor.execute("""INSERT INTO Rating(user_id, query,
answer, weight, task_id, created_at)