create table wait_tickets(
                             ticket_id BIGINT NOT NULL references tickets(id),
                             wait_until timestamp with time zone NOT NULL,
                             deleted boolean not null,
                             user_id BIGINT NOT NULL references users(id),
                             changed_at timestamp with time zone not null
);
create unique index wait_tickets_ticket_id on wait_tickets(ticket_id);

alter table tickets add has_wait_ticket boolean, add notify_wait_return boolean;
