Skip to content

Commit 4bf10df

Browse files
committed
Remove obsolete participant/sample table external_id constraints
(But first we need to create indexes for the correspondingly named foreign keys, which previously re-used these constraints' composite indexes. This avoids "Cannot drop index needed in a foreign key constraint" errors.)
1 parent 7ba16df commit 4bf10df

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

db/project.xml

+14
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,13 @@
13191319
constraintName="UK_PARTICIPANT_EXTERNAL_ID_UNIQUE_EIDS"
13201320
validate="true"
13211321
/>
1322+
<createIndex tableName="participant" indexName="fk_project_participant">
1323+
<column name="project" />
1324+
</createIndex>
1325+
<dropUniqueConstraint
1326+
tableName="participant"
1327+
constraintName="UK_PARTICIPANT_SAMPLE_EXTERNALID"
1328+
/>
13221329

13231330
<createTable tableName="sample_external_id">
13241331
<column name="project" type="INT">
@@ -1357,6 +1364,13 @@
13571364
constraintName="UK_SAMPLE_EXTERNAL_ID_UNIQUE_EIDS"
13581365
validate="true"
13591366
/>
1367+
<createIndex tableName="sample" indexName="fk_project_sample">
1368+
<column name="project" />
1369+
</createIndex>
1370+
<dropUniqueConstraint
1371+
tableName="sample"
1372+
constraintName="UK_SAMPLE_PROJECT_EXTERNALID"
1373+
/>
13601374

13611375
<sql>ALTER TABLE participant_external_id ADD SYSTEM VERSIONING;</sql>
13621376
<sql>ALTER TABLE sample_external_id ADD SYSTEM VERSIONING;</sql>

0 commit comments

Comments
 (0)