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

* Initial Implementation of Custom Metrics Measurement Units * Update generated TypeScript types * Removed Regex patterns and length validations as they are not needed * Add a new column with index for custom units * Remove comments in the sql * update ui and add playwright * fix metric selector * fix tests * address feedbacks * remove unused field --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com> Co-authored-by: karanh37 <karanh37@gmail.com>
26 lines
1.1 KiB
SQL
26 lines
1.1 KiB
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')
|
|
);
|
|
|
|
-- Add virtual column for customUnitOfMeasurement
|
|
ALTER TABLE metric_entity
|
|
ADD COLUMN customUnitOfMeasurement VARCHAR(256)
|
|
GENERATED ALWAYS AS (json_unquote(json_extract(json, '$.customUnitOfMeasurement'))) VIRTUAL;
|
|
-- Add index on the virtual column
|
|
CREATE INDEX idx_metric_custom_unit ON metric_entity(customUnitOfMeasurement); |