migrate serviceType (#18226)

This commit is contained in:
Siddhant 2024-10-11 01:47:29 +05:30 committed by GitHub
parent bff50664b9
commit c6e12fe703
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 0 deletions

View File

@ -43,3 +43,18 @@ UPDATE installed_apps SET json = JSON_SET(json, '$.supportsInterrupt', true) whe
UPDATE apps_marketplace SET json = JSON_SET(json, '$.supportsInterrupt', true) where name = 'SearchIndexingApplication';
ALTER TABLE apps_extension_time_series ADD COLUMN appName VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.appName') STORED NOT NULL;
-- Update serviceType in api_endpoint_entity table
UPDATE api_endpoint_entity
SET json = JSON_SET(json, '$.serviceType', 'Rest')
WHERE JSON_UNQUOTE(JSON_EXTRACT(json, '$.serviceType')) = 'REST';
-- Update serviceType in api_service_entity table
UPDATE api_service_entity
SET json = JSON_SET(json, '$.serviceType', 'Rest')
WHERE JSON_UNQUOTE(JSON_EXTRACT(json, '$.serviceType')) = 'REST';
-- Update serviceType in api_collection_entity table
UPDATE api_collection_entity
SET json = JSON_SET(json, '$.serviceType', 'Rest')
WHERE JSON_UNQUOTE(JSON_EXTRACT(json, '$.serviceType')) = 'REST';

View File

@ -60,3 +60,18 @@ SET json = jsonb_set(
where name = 'SearchIndexingApplication';
ALTER TABLE apps_extension_time_series ADD COLUMN appName VARCHAR(256) GENERATED ALWAYS AS (json ->> 'appName') STORED NOT NULL;
-- Update serviceType in api_endpoint_entity table
UPDATE api_endpoint_entity
SET json = jsonb_set(json, '{serviceType}', '"Rest"')
WHERE jsonb_extract_path_text(json, 'serviceType') = 'REST';
-- Update serviceType in api_service_entity table
UPDATE api_service_entity
SET json = jsonb_set(json, '{serviceType}', '"Rest"')
WHERE jsonb_extract_path_text(json, 'serviceType') = 'REST';
-- Update serviceType in api_collection_entity table
UPDATE api_collection_entity
SET json = jsonb_set(json, '{serviceType}', '"Rest"')
WHERE jsonb_extract_path_text(json, 'serviceType') = 'REST';