diff --git a/packages/server/src/main/resources/db/migration/V17__project_asset_constraint.sql b/packages/server/src/main/resources/db/migration/V17__project_asset_constraint.sql new file mode 100644 index 0000000000..d44111f5f1 --- /dev/null +++ b/packages/server/src/main/resources/db/migration/V17__project_asset_constraint.sql @@ -0,0 +1,20 @@ +BEGIN; + +ALTER TABLE project_asset + DROP CONSTRAINT project_asset_asset_type_check; + +ALTER TABLE project_asset + ADD CONSTRAINT project_asset_asset_type_check + CHECK (asset_type::text = ANY (ARRAY[ + 'WORKFLOW'::character varying, + 'MODEL'::character varying, + 'DATASET'::character varying, + 'SIMULATION'::character varying, + 'DOCUMENT'::character varying, + 'CODE'::character varying, + 'MODEL_CONFIGURATION'::character varying, + 'ARTIFACT'::character varying, + 'INTERVENTION_POLICY'::character varying + ])); + +COMMIT;