mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-28 10:25:20 +00:00

* MINOR - Domain Independent DP Rule * handle DP * Handle DP * add migration * improve rule mgmt * improve rule mgmt * add test for bulk op * fix test * handle in bulk --------- Co-authored-by: sonika-shah <58761340+sonika-shah@users.noreply.github.com>
19 lines
747 B
SQL
19 lines
747 B
SQL
-- Add "Data Product Domain Validation" rule to existing entityRulesSettings configuration
|
|
UPDATE openmetadata_settings
|
|
SET json = JSON_ARRAY_APPEND(
|
|
json,
|
|
'$.entitySemantics',
|
|
JSON_OBJECT(
|
|
'name', 'Data Product Domain Validation',
|
|
'description', 'Validates that Data Products assigned to an entity match the entity''s domains.',
|
|
'rule', '{"validateDataProductDomainMatch":[{"var":"dataProducts"},{"var":"domains"}]}',
|
|
'enabled', true,
|
|
'provider', 'system'
|
|
)
|
|
)
|
|
WHERE configType = 'entityRulesSettings'
|
|
AND JSON_EXTRACT(json, '$.entitySemantics') IS NOT NULL
|
|
AND NOT JSON_CONTAINS(
|
|
JSON_EXTRACT(json, '$.entitySemantics[*].name'),
|
|
JSON_QUOTE('Data Product Domain Validation')
|
|
); |