--- ticket-category-and-tags-table

create table if not exists tickets_to_categories (
    ticket_id bigint not null,
    category_id bigint not null,
    PRIMARY KEY (ticket_id, category_id)
);

create table if not exists tickets_to_tags (
    ticket_id bigint not null,
    tag_id bigint not null,
    PRIMARY KEY (ticket_id, tag_id)
);