Skip to content

Commit

Permalink
Add not valid to check contraints
Browse files Browse the repository at this point in the history
  • Loading branch information
amandine-sahl committed Nov 5, 2024
1 parent 3bdda83 commit cd384a5
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 cd384a5

Please sign in to comment.