| 
									
										
										
										
											2024-06-20 08:38:21 +02:00
										 |  |  | -- matchEnum Test Definition Parameter for columnValuesToBeInSet
 | 
					
						
							| 
									
										
										
										
											2024-05-28 09:30:30 +02:00
										 |  |  | UPDATE test_definition
 | 
					
						
							|  |  |  | SET json = jsonb_set(json, '{parameterDefinition}', json->'parameterDefinition' || '['
 | 
					
						
							|  |  |  |     '{"name": "matchEnum", "displayName": "Match enum", "description": "If enabled, validate that each value independently matches the enum.", "dataType": "BOOLEAN", "required": false, "optionValues": []}'
 | 
					
						
							|  |  |  |     ']'::jsonb
 | 
					
						
							|  |  |  | )
 | 
					
						
							|  |  |  | WHERE name = 'columnValuesToBeInSet'
 | 
					
						
							|  |  |  | AND JSONB_ARRAY_LENGTH(json->'parameterDefinition') < 2;
 | 
					
						
							| 
									
										
										
										
											2024-06-10 11:03:55 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | -- Test Case dyanic test migration
 | 
					
						
							|  |  |  | UPDATE test_definition
 | 
					
						
							|  |  |  | SET json = JSONB_SET(json, '{supportsDynamicAssertion}', 'true', true)
 | 
					
						
							|  |  |  | WHERE name IN (
 | 
					
						
							|  |  |  | 	'columnValueMaxToBeBetween',
 | 
					
						
							|  |  |  |     'columnValueMeanToBeBetween',
 | 
					
						
							|  |  |  |     'columnValueMedianToBeBetween',
 | 
					
						
							|  |  |  |     'columnValueMinToBeBetween',
 | 
					
						
							|  |  |  |     'columnValueStdDevToBeBetween',
 | 
					
						
							| 
									
										
										
										
											2024-07-26 08:19:50 +02:00
										 |  |  |     'columnValueLengthsToBeBetween',
 | 
					
						
							| 
									
										
										
										
											2024-06-10 11:03:55 +02:00
										 |  |  |     'columnValuesSumToBeBetween',
 | 
					
						
							|  |  |  |     'columnValuesToBeBetween',
 | 
					
						
							|  |  |  |     'tableRowCountToBeBetween'
 | 
					
						
							| 
									
										
										
										
											2024-06-20 08:38:21 +02:00
										 |  |  | );
 | 
					
						
							| 
									
										
										
										
											2024-07-19 11:39:09 +05:30
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-30 17:38:43 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  | -- KPI Migrations
 | 
					
						
							|  |  |  | UPDATE entity_relationship
 | 
					
						
							|  |  |  | SET    toid = (SELECT id
 | 
					
						
							|  |  |  |                FROM   di_chart_entity
 | 
					
						
							|  |  |  |                WHERE  NAME = 'percentage_of_data_asset_with_owner_kpi'),
 | 
					
						
							|  |  |  |        toentity = 'dataInsightCustomChart'
 | 
					
						
							|  |  |  | WHERE  toid = (SELECT id
 | 
					
						
							|  |  |  |                FROM   data_insight_chart dic
 | 
					
						
							|  |  |  |                WHERE  NAME = 'PercentageOfEntitiesWithOwnerByType')
 | 
					
						
							|  |  |  |        AND fromId IN (SELECT id from kpi_entity WHERE json ->> 'metricType' = 'PERCENTAGE')
 | 
					
						
							|  |  |  |        AND toentity = 'dataInsightChart'
 | 
					
						
							|  |  |  |        AND fromentity = 'kpi';
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | UPDATE entity_relationship
 | 
					
						
							|  |  |  | SET    toid = (SELECT id
 | 
					
						
							|  |  |  |                FROM   di_chart_entity
 | 
					
						
							|  |  |  |                WHERE  NAME = 'number_of_data_asset_with_owner_kpi'),
 | 
					
						
							|  |  |  |        toentity = 'dataInsightCustomChart'
 | 
					
						
							|  |  |  | WHERE  toid = (SELECT id
 | 
					
						
							|  |  |  |                FROM   data_insight_chart dic
 | 
					
						
							|  |  |  |                WHERE  NAME = 'PercentageOfEntitiesWithOwnerByType')
 | 
					
						
							|  |  |  |        AND fromId IN (SELECT id from kpi_entity WHERE json ->> 'metricType' = 'NUMBER')
 | 
					
						
							|  |  |  |        AND toentity = 'dataInsightChart'
 | 
					
						
							|  |  |  |        AND fromentity = 'kpi';
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | UPDATE entity_relationship
 | 
					
						
							|  |  |  | SET    toid = (SELECT id
 | 
					
						
							|  |  |  |                FROM   di_chart_entity
 | 
					
						
							|  |  |  |                WHERE  NAME = 'percentage_of_data_asset_with_description_kpi'),
 | 
					
						
							|  |  |  |        toentity = 'dataInsightCustomChart'
 | 
					
						
							|  |  |  | WHERE  toid = (SELECT id
 | 
					
						
							|  |  |  |                FROM   data_insight_chart dic
 | 
					
						
							|  |  |  |                WHERE  NAME = 'PercentageOfEntitiesWithDescriptionByType')
 | 
					
						
							|  |  |  |        AND fromId IN (SELECT id from kpi_entity WHERE json ->> 'metricType' = 'PERCENTAGE')
 | 
					
						
							|  |  |  |        AND toentity = 'dataInsightChart'
 | 
					
						
							|  |  |  |        AND fromentity = 'kpi';
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | UPDATE entity_relationship
 | 
					
						
							|  |  |  | SET    toid = (SELECT id
 | 
					
						
							|  |  |  |                FROM   di_chart_entity
 | 
					
						
							|  |  |  |                WHERE  NAME = 'number_of_data_asset_with_description_kpi'),
 | 
					
						
							|  |  |  |        toentity = 'dataInsightCustomChart'
 | 
					
						
							|  |  |  | WHERE  toid = (SELECT id
 | 
					
						
							|  |  |  |                FROM   data_insight_chart dic
 | 
					
						
							|  |  |  |                WHERE  NAME = 'PercentageOfEntitiesWithDescriptionByType')
 | 
					
						
							|  |  |  |        AND fromId IN (SELECT id from kpi_entity WHERE json ->> 'metricType' = 'NUMBER')
 | 
					
						
							|  |  |  |        AND toentity = 'dataInsightChart'
 | 
					
						
							|  |  |  |        AND fromentity = 'kpi';
 | 
					
						
							|  |  |  | -- KPI MIgrations end
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-23 17:42:26 +02:00
										 |  |  | -- Update schedule type for applications
 | 
					
						
							|  |  |  | UPDATE installed_apps
 | 
					
						
							|  |  |  | SET json = json || '{"scheduleType": "ScheduledOrManual"}'
 | 
					
						
							|  |  |  | WHERE json->>'scheduleType' = 'Scheduled';
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | -- recreate all scheduled apps
 | 
					
						
							|  |  |  | DELETE FROM apps_marketplace
 | 
					
						
							| 
									
										
										
										
											2024-07-28 17:55:06 +05:30
										 |  |  | WHERE json->>'scheduleType' = 'Scheduled';
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ALTER TABLE thread_entity DROP COLUMN entityId;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | -- Add entityRef column to thread_entity table
 | 
					
						
							|  |  |  | UPDATE thread_entity
 | 
					
						
							|  |  |  | SET json = jsonb_set(
 | 
					
						
							|  |  |  |     json - 'entityId' - 'entityType',
 | 
					
						
							|  |  |  |     '{entityRef}',
 | 
					
						
							|  |  |  |     jsonb_build_object(
 | 
					
						
							|  |  |  |         'id', json->>'entityId',
 | 
					
						
							|  |  |  |         'type', json->>'entityType'
 | 
					
						
							|  |  |  |     ),
 | 
					
						
							|  |  |  |     true
 | 
					
						
							|  |  |  | )
 | 
					
						
							|  |  |  | WHERE jsonb_exists(json, 'entityId') OR jsonb_exists(json, 'entityType');
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | -- Add entityId and type column to thread_entity table
 | 
					
						
							|  |  |  | ALTER TABLE thread_entity ADD COLUMN entityId VARCHAR(36) GENERATED ALWAYS AS (json->'entityRef'->>'id') STORED;
 | 
					
						
							|  |  |  | ALTER TABLE thread_entity ADD COLUMN entityType VARCHAR(36) GENERATED ALWAYS AS (json->'entityRef'->>'type') STORED;
 | 
					
						
							| 
									
										
										
										
											2024-08-19 14:28:42 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | UPDATE test_definition
 | 
					
						
							|  |  |  | SET json = jsonb_set(
 | 
					
						
							|  |  |  |     json,
 | 
					
						
							|  |  |  |     '{supportedDataTypes}',
 | 
					
						
							|  |  |  |     '["NUMBER", "TINYINT", "SMALLINT", "INT", "BIGINT", "BYTEINT", "BYTES", "FLOAT", "DOUBLE", "DECIMAL", "NUMERIC", "TIMESTAMP", "TIMESTAMPZ", "TIME", "DATE", "DATETIME", "INTERVAL", "STRING", "MEDIUMTEXT", "TEXT", "CHAR", "VARCHAR", "BOOLEAN", "BINARY", "VARBINARY", "BLOB", "LONGBLOB", "MEDIUMBLOB", "MAP", "STRUCT", "UNION", "SET", "GEOGRAPHY", "ENUM", "UUID", "VARIANT", "GEOMETRY", "POINT", "POLYGON"]'::jsonb
 | 
					
						
							|  |  |  | )
 | 
					
						
							|  |  |  | WHERE name = 'columnValuesToBeUnique';
 |