altocompta/sql/upgrade.sql

7 lines
477 B
SQL

create table action_comment_document (acd_id bigint generated by default as identity primary key
, document_id bigint references document(d_id) on delete cascade on update cascade,
action_gestion_comment_id bigint references action_gestion_comment(agc_id) on delete cascade on update cascade);
alter table action_comment_document
add constraint action_comment_document_un
unique (document_id, action_gestion_comment_id);