--- worktime

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

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

    enabled bit not null,
    deleted bit not null,

    created_at datetimeoffset not null,
    updated_at datetimeoffset not null
);

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