Implement job queue for asynchronous NLP #6

Merged
dylan merged 14 commits from feat/implement-job-queue into main 2026-03-03 14:26:38 +00:00
Showing only changes of commit 63cd465189 - Show all commits

View File

@@ -11,9 +11,19 @@ CREATE TABLE datasets (
user_id INTEGER NOT NULL, user_id INTEGER NOT NULL,
name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL,
description TEXT, description TEXT,
-- Job state machine
status TEXT NOT NULL DEFAULT 'processing',
status_message TEXT,
completed_at TIMESTAMP,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
topics JSONB, topics JSONB,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
-- Enforce valid states
CONSTRAINT datasets_status_check
CHECK (status IN ('processing', 'complete', 'error'))
); );
CREATE TABLE events ( CREATE TABLE events (