OpenMetadata/bootstrap/sql/migrations/native/1.12.0/mysql/postDataMigrationSQLScript.sql
Teddy 2aac0b29ad
ISSUE #2652 - Freshness TZ (#25261)
* feat: add freshness tz support

* feat: added localization to handle DST

* style: fix code formatting and variable names

* style: ran python linting

* style: ram python linting

* style: fix linitng errors

* style: fix linting for GX based on version

* Fix: pass a string array to psql migration
2026-01-19 11:46:18 +01:00

58 lines
3.4 KiB
SQL

UPDATE test_definition
SET json = JSON_SET(
json,
'$.supportedServices',
JSON_ARRAY('Snowflake', 'BigQuery', 'Athena', 'Redshift', 'Postgres', 'MySQL', 'Mssql', 'Oracle', 'Trino', 'SapHana')
)
WHERE name = 'tableDiff'
AND (
JSON_EXTRACT(json, '$.supportedServices') IS NULL
OR JSON_LENGTH(JSON_EXTRACT(json, '$.supportedServices')) = 0
);
-- Add timezone parameter to tableDataToBeFresh test definition
UPDATE test_definition
SET json = JSON_ARRAY_APPEND(
json,
'$.parameterDefinition',
JSON_OBJECT(
'name', 'timezone',
'displayName', 'Timezone',
'description', 'Timezone for the range calculation',
'dataType', 'STRING',
'required', false,
'optionValues', JSON_ARRAY(
'UTC',
'Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', 'Africa/Cairo',
'Africa/Casablanca', 'Africa/Johannesburg', 'Africa/Lagos', 'Africa/Nairobi', 'Africa/Tunis',
'America/Anchorage', 'America/Argentina/Buenos_Aires', 'America/Bogota', 'America/Caracas',
'America/Chicago', 'America/Denver', 'America/Edmonton', 'America/Halifax', 'America/Havana',
'America/Lima', 'America/Los_Angeles', 'America/Manaus', 'America/Mexico_City', 'America/New_York',
'America/Panama', 'America/Phoenix', 'America/Puerto_Rico', 'America/Regina', 'America/Santiago',
'America/Sao_Paulo', 'America/St_Johns', 'America/Toronto', 'America/Vancouver', 'America/Winnipeg',
'Antarctica/McMurdo',
'Asia/Almaty', 'Asia/Amman', 'Asia/Baghdad', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Beirut',
'Asia/Colombo', 'Asia/Damascus', 'Asia/Dhaka', 'Asia/Dubai', 'Asia/Ho_Chi_Minh', 'Asia/Hong_Kong',
'Asia/Istanbul', 'Asia/Jakarta', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Karachi', 'Asia/Kathmandu',
'Asia/Kolkata', 'Asia/Kuala_Lumpur', 'Asia/Kuwait', 'Asia/Manila', 'Asia/Muscat', 'Asia/Nicosia',
'Asia/Novosibirsk', 'Asia/Qatar', 'Asia/Riyadh', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore',
'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tehran', 'Asia/Tokyo', 'Asia/Vladivostok', 'Asia/Yangon',
'Asia/Yekaterinburg',
'Atlantic/Azores', 'Atlantic/Canary', 'Atlantic/Cape_Verde', 'Atlantic/Reykjavik',
'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Darwin', 'Australia/Hobart',
'Australia/Melbourne', 'Australia/Perth', 'Australia/Sydney',
'Europe/Amsterdam', 'Europe/Athens', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Brussels',
'Europe/Bucharest', 'Europe/Budapest', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Helsinki',
'Europe/Kyiv', 'Europe/Lisbon', 'Europe/London', 'Europe/Madrid', 'Europe/Malta', 'Europe/Minsk',
'Europe/Moscow', 'Europe/Oslo', 'Europe/Paris', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome',
'Europe/Samara', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Vienna',
'Europe/Vilnius', 'Europe/Warsaw', 'Europe/Zurich',
'Indian/Maldives', 'Indian/Mauritius',
'Pacific/Auckland', 'Pacific/Fiji', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Noumea',
'Pacific/Pago_Pago', 'Pacific/Port_Moresby', 'Pacific/Tahiti', 'Pacific/Tongatapu'
),
'defaultValue', 'UTC'
)
)
WHERE name = 'tableDataToBeFresh'
AND NOT JSON_CONTAINS(JSON_EXTRACT(json, '$.parameterDefinition[*].name'), '"timezone"');