create table action.hierarchy_node_to_form_id
(
    hierarchy_id int not null,
    node_id      int not null,
    form_id      int not null,
    account_id   int not null,
    constraint hierarchy_node_to_form_id_pk
        primary key (hierarchy_id, node_id),
    constraint hierarchy_node_to_form_id_forms_form_id_fk
        foreign key (form_id) references action.forms (form_id)
            on delete cascade
);

alter table action.hierarchy_node_to_form_id
    add constraint hierarchy_node_to_form_id_accounts_account_id_fk
        foreign key (account_id) references configure.accounts (account_id)
            on delete cascade;

