--- worktime

create table worktimes (
    id bigint primary key,
    project_id bigint not null references projects(id),
    title varchar(255) not null,

    user_id bigint not null references users(id),
    days varchar(4000) not null,
    start_hour integer not null,
    end_hour integer not null,
    comment varchar(4000) not null,

    enabled boolean not null,
    deleted boolean not null,

    created_at timestamptz not null,
    updated_at timestamptz not null
);

create sequence worktimes_id_seq;

create unique index worktimes_project_uniq
on worktimes(project_id) where enabled = true;
