-- подключаемся к базе данных
\connect tasks;

CREATE TYPE task_manager.task_status AS ENUM('todo','in_progress','paused','test','review','done');

CREATE TABLE IF NOT EXISTS task_manager.tasks(
    id serial PRIMARY KEY NOT NULL  UNIQUE,
    id_user integer,
    name TEXT NOT NULL,
    description TEXT,
    status task_manager.task_status NOT NULL default 'todo',
    creation_date date NOT NULL default Now(),
    update_date date NOT NULL default Now(),
    FOREIGN KEY (id_user) REFERENCES task_manager.users (id) ON DELETE CASCADE
);
