Skip to content

Commit

Permalink
#513 added DB constraint to check that the duplicate dataset key is d…
Browse files Browse the repository at this point in the history
…ifferent than the dataset key
  • Loading branch information
marcos-lg committed Dec 29, 2023
1 parent 9d48ca2 commit a4b31f7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">

<changeSet id="129" author="mlopez" runInTransaction="false">
<sql splitStatements="false" stripComments="false">
<![CDATA[
ALTER TABLE dataset ADD CONSTRAINT duplicate_key_not_equal_key CHECK(duplicate_of_dataset_key != key)
]]>
</sql>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,5 @@
<include file="liquibase/126-wikidata-ncbi-identifier-types.xml" />
<include file="liquibase/127-organization-country-not-null.xml" />
<include file="liquibase/128-parent-code-occurrence-mapping.xml" />
<include file="liquibase/129-duplicate-dataset-key-constraint.xml" />
</databaseChangeLog>

0 comments on commit a4b31f7

Please sign in to comment.