create table tasks
(
    id          integer                        not null
        constraint tasks_pk
            primary key autoincrement,
    payload_key ANY                            not null
        constraint tasks_payload_key
            unique on conflict ignore,
    payload     TEXT                           not null,
    status_id   integer                        not null
        constraint tasks_task_statuses_id_fk
            references statuses,
    created_at  TEXT default CURRENT_TIMESTAMP not null,
    updated_at  TEXT
);

create unique index tasks_payload_key_uindex
    on tasks (payload_key);

