Skip to content

Commit

Permalink
Add not valid to bib_fields check constraints (#3248)
Browse files Browse the repository at this point in the history
  • Loading branch information
amandine-sahl authored Nov 21, 2024
1 parent 33d6233 commit c7b3950
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ def upgrade():

op.execute(
"""
alter table gn_imports.bib_fields
ADD CONSTRAINT mandatory_conditions_field_exists CHECK (gn_imports.isInNameFields(mandatory_conditions,id_destination));
ALTER TABLE gn_imports.bib_fields
ADD CONSTRAINT mandatory_conditions_field_exists CHECK (gn_imports.isInNameFields(mandatory_conditions,id_destination))
NOT VALID;
"""
)
op.execute(
"""
alter table gn_imports.bib_fields
ADD CONSTRAINT optional_conditions_field_exists CHECK (gn_imports.isInNameFields(optional_conditions,id_destination));
ALTER TABLE gn_imports.bib_fields
ADD CONSTRAINT optional_conditions_field_exists CHECK (gn_imports.isInNameFields(optional_conditions,id_destination))
NOT VALID;
"""
)
conn = op.get_bind()
Expand Down

0 comments on commit c7b3950

Please sign in to comment.