fyp/sql/tasks.sql
Andre Henriques 0ac6ac8dce runner-go (#102)
Reviewed-on: #102
Co-authored-by: Andre Henriques <andr3h3nriqu3s@gmail.com>
Co-committed-by: Andre Henriques <andr3h3nriqu3s@gmail.com>
2024-05-10 02:13:02 +01:00

52 lines
1.4 KiB
SQL

-- 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 '',
extra_task_info 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
);
create table if not exists tasks_dependencies (
id uuid primary key default gen_random_uuid(),
main_id uuid references tasks (id) on delete cascade not null,
dependent_id uuid references tasks (id) on delete cascade not null
);
create table if not exists remote_runner (
id uuid primary key default gen_random_uuid(),
user_id uuid references users (id) on delete cascade not null,
token text not null,
-- 1: GPU
type integer,
created_on timestamp default current_timestamp
);