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