CREATE TABLE IF NOT EXISTS tasks( id bigserial PRIMARY KEY, worker_id uuid REFERENCES workers(id), file_id bigint REFERENCES files(id) NOT NULL, type smallint NOT NULL, status smallint NOT NULL, data JSONB, log text[] );