feat: add tasks closes #74

This commit is contained in:
2024-04-12 20:36:23 +01:00
parent 143ad3b02b
commit eb20c1b0ac
21 changed files with 986 additions and 232 deletions

33
sql/tasks.sql Normal file
View File

@@ -0,0 +1,33 @@
-- drop table if exists tasks
create table if not exists tasks (
id uuid primary key default gen_random_uuid(),
user_id uuid references users (id) not null,
model_id uuid references models (id) on delete cascade default null,
-- -2: Failed Running
-- -1: Failed Creation
-- 0: Preparing
-- 1: TODO
-- 2: Picked up
-- 3: Running
-- 4: Failed
status integer default 1,
status_message text default '',
result text default '',
-- -1: user said task is wrong
-- 0: no user input
-- 1: user said task is ok
user_confirmed integer default 0,
-- Tells the user if the file has been already compacted into
-- embendings
compacted integer default 0,
-- TODO move the training tasks to here
-- 1: Classification
task_type integer,
created_on timestamp default current_timestamp
)