feat: dataset now persists to database

This commit is contained in:
2026-03-01 16:01:15 +00:00
parent 0be9ff4896
commit 5fb7710dc2
4 changed files with 104 additions and 16 deletions

View File

@@ -17,16 +17,24 @@ CREATE TABLE datasets (
);
CREATE TABLE events (
/* Required Fields */
id SERIAL PRIMARY KEY,
dataset_id INTEGER NOT NULL,
parent_post_id INTEGER NOT NULL,
author VARCHAR(255) NOT NULL,
content TEXT NOT NULL,
created_at TIMESTAMP NOT NULL,
timestamp BIGINT NOT NULL,
date DATE NOT NULL,
dt TIMESTAMP NOT NULL,
hour INTEGER NOT NULL,
weekday VARCHAR(255) NOT NULL,
/* Comments and Replies */
parent_id VARCHAR(255),
reply_to VARCHAR(255),
source VARCHAR(255) NOT NULL,
/* NLP Fields */
topic VARCHAR(255),
topic_confidence FLOAT,
@@ -38,6 +46,5 @@ CREATE TABLE events (
emotion_joy FLOAT,
emotion_sadness FLOAT,
FOREIGN KEY (parent_post_id) REFERENCES events(id) ON DELETE CASCADE,
FOREIGN KEY (dataset_id) REFERENCES datasets(id) ON DELETE CASCADE
);