OpenMetadata/bootstrap/sql/migrations/native/1.12.8/postgres/postDataMigrationSQLScript.sql
Eugenio 483461a003
Add migrations to ensure PII are really enabled (#27921)
This is especially needed for instances that had already upgraded to 1.12.0 onwards, those instaces skipped the migration cherry-picked in 1.12.6
2026-05-08 15:39:29 +00:00

19 lines
761 B
SQL

-- Fix PII classification autoClassificationConfig (issue #27910)
UPDATE classification
SET json = jsonb_set(
json::jsonb,
'{autoClassificationConfig}',
'{"enabled": true, "conflictResolution": "highest_priority", "minimumConfidence": 0.6, "requireExplicitMatch": true}'::jsonb
)::json
WHERE json->>'name' = 'PII'
AND json->'autoClassificationConfig'->>'enabled' IS NULL;
-- Fix PII tags autoClassificationEnabled (issue #27910)
UPDATE tag
SET json = jsonb_set(json::jsonb, '{autoClassificationEnabled}', 'true'::jsonb)::json
WHERE json->'classification'->>'name' = 'PII'
AND json->>'name' IN ('NonSensitive', 'Sensitive')
AND (
json->>'autoClassificationEnabled' IS NULL
OR (json->>'autoClassificationEnabled')::boolean = false
);