create table template_hosts
(
    template_id bigint not null references templates (id) on update cascade on delete cascade,
    host_id     bigint not null references hosts (id) on update cascade on delete cascade,
    primary key (template_id, host_id)
);

create index template_hosts_host_id_idx on template_hosts (host_id);
