Skip to content

Commit

Permalink
Fix enum constraint checks missing from Liquibase changelog
Browse files Browse the repository at this point in the history
Fixes DependencyTrack/hyades#1030

Signed-off-by: nscuro <[email protected]>
  • Loading branch information
nscuro committed Jan 30, 2024
1 parent 19824e5 commit ace7bc4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/main/resources/migration/changelog-v5.3.0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2416,4 +2416,28 @@
<column name="LOG_SUCCESSFUL_PUBLISH" type="BOOLEAN"/>
</addColumn>
</changeSet>

<changeSet id="v5.3.0-11" author="[email protected]">
<sql splitStatements="true">
ALTER TABLE "COMPONENT" DROP CONSTRAINT IF EXISTS "COMPONENT_CLASSIFIER_check";
ALTER TABLE "COMPONENT" ADD CONSTRAINT "COMPONENT_CLASSIFIER_check"
CHECK ("CLASSIFIER" IS NULL OR "CLASSIFIER"::TEXT = ANY(ARRAY['APPLICATION', 'CONTAINER', 'DEVICE', 'FILE', 'FIRMWARE', 'FRAMEWORK', 'LIBRARY', 'OPERATING_SYSTEM']));

ALTER TABLE "INTEGRITY_META_COMPONENT" DROP CONSTRAINT IF EXISTS "INTEGRITY_META_COMPONENT_STATUS_check";
ALTER TABLE "INTEGRITY_META_COMPONENT" ADD CONSTRAINT "INTEGRITY_META_COMPONENT_STATUS_check"
CHECK ("STATUS" IS NULL OR "STATUS"::TEXT = ANY(ARRAY['IN_PROGRESS', 'NOT_AVAILABLE', 'PROCESSED']));

ALTER TABLE "PROJECT" DROP CONSTRAINT IF EXISTS "PROJECT_CLASSIFIER_check";
ALTER TABLE "PROJECT" ADD CONSTRAINT "PROJECT_CLASSIFIER_check"
CHECK ("CLASSIFIER" IS NULL OR "CLASSIFIER"::TEXT = ANY(ARRAY['APPLICATION', 'CONTAINER', 'DEVICE', 'FILE', 'FIRMWARE', 'FRAMEWORK', 'LIBRARY', 'OPERATING_SYSTEM']));

ALTER TABLE "WORKFLOW_STATE" DROP CONSTRAINT IF EXISTS "WORKFLOW_STATE_STEP_check";
ALTER TABLE "WORKFLOW_STATE" ADD CONSTRAINT "WORKFLOW_STATE_STEP_check"
CHECK ("STEP"::TEXT = ANY(ARRAY['BOM_CONSUMPTION', 'BOM_PROCESSING', 'METRICS_UPDATE', 'POLICY_BUNDLE_SYNC', 'POLICY_EVALUATION', 'REPO_META_ANALYSIS', 'VULN_ANALYSIS']));

ALTER TABLE "WORKFLOW_STATE" DROP CONSTRAINT IF EXISTS "WORKFLOW_STATE_STATUS_check";
ALTER TABLE "WORKFLOW_STATE" ADD CONSTRAINT "WORKFLOW_STATE_STATUS_check"
CHECK ("STATUS"::TEXT = ANY(ARRAY['CANCELLED', 'COMPLETED', 'FAILED', 'NOT_APPLICABLE', 'PENDING', 'TIMED_OUT']));
</sql>
</changeSet>
</databaseChangeLog>

0 comments on commit ace7bc4

Please sign in to comment.