From b2fe3052dc579d95f2f996c7064af482ed479156 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Thu, 7 Aug 2025 09:28:33 -0400 Subject: [PATCH] schema notes --- .../20250708000000_create_tasks_table.sql | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/_sql/artcraft_migrations/20250708000000_create_tasks_table.sql b/_sql/artcraft_migrations/20250708000000_create_tasks_table.sql index 9b0c4d0329..369d523c76 100644 --- a/_sql/artcraft_migrations/20250708000000_create_tasks_table.sql +++ b/_sql/artcraft_migrations/20250708000000_create_tasks_table.sql @@ -4,17 +4,37 @@ -- tasks_v2.sqlite - added model_type (nullable) CREATE TABLE tasks ( + -- Task auto-incrementing primary key. + -- We don't use this. id TEXT NOT NULL PRIMARY KEY, + -- TaskStatus enum + -- This is how the job system manages job states. + -- pending, started, complete_success, dead, etc. task_status TEXT NOT NULL, + + -- TaskType enum + -- image_generation, video_generation, etc. task_type TEXT NOT NULL, + -- TaskModelType enum + -- flux_1_dev, veo_2, etc. model_type TEXT, + -- GenerationProvider enum + -- Together with `provider_job_id`, this creates a foreign key lookup to the job. + -- 'artcraft', 'fal', 'sora', etc. provider TEXT, + + -- The primary key for the job in the provider's system. provider_job_id TEXT, + -- OPTIONAL. + -- An arbitrary payload the frontend can set. frontend_subscriber_id TEXT, + + -- OPTIONAL. + -- A JSON payload for the frontend subscriber. frontend_subscriber_payload TEXT, created_at INTEGER NOT NULL DEFAULT (unixepoch('now')),