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