MINOR - Move app migrations to 1.3.2 (#15690)

This commit is contained in:
Pere Miquel Brull 2024-03-26 08:43:15 +01:00 committed by GitHub
parent 17434429c4
commit f28f196c34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 21 additions and 21 deletions

View File

@ -1,2 +1,11 @@
ALTER TABLE test_case ADD COLUMN status VARCHAR(56) GENERATED ALWAYS AS (json ->> '$.testCaseResult.testCaseStatus') STORED NULL;
ALTER TABLE test_case ADD COLUMN entityLink VARCHAR(512) GENERATED ALWAYS AS (json ->> '$.entityLink') STORED NOT NULL;
ALTER TABLE test_case ADD COLUMN entityLink VARCHAR(512) GENERATED ALWAYS AS (json ->> '$.entityLink') STORED NOT NULL;
-- Change scheduleType to scheduleTimeline
UPDATE installed_apps
SET json = JSON_INSERT(
JSON_REMOVE(json, '$.appSchedule.scheduleType'),
'$.appSchedule.scheduleTimeline',
JSON_EXTRACT(json, '$.appSchedule.scheduleType')
);
delete from apps_extension_time_series;

View File

@ -1,2 +1,12 @@
ALTER TABLE test_case ADD COLUMN status VARCHAR(56) GENERATED ALWAYS AS (json -> 'testCaseResult' ->> 'testCaseStatus') STORED NULL;
ALTER TABLE test_case ADD COLUMN entityLink VARCHAR(512) GENERATED ALWAYS AS (json ->> 'entityLink') STORED NOT NULL;
ALTER TABLE test_case ADD COLUMN entityLink VARCHAR(512) GENERATED ALWAYS AS (json ->> 'entityLink') STORED NOT NULL;
-- change scheduleType to scheduleTimeline
UPDATE installed_apps
SET json = jsonb_set(
json::jsonb #- '{appSchedule,scheduleType}',
'{appSchedule,scheduleTimeline}',
(json #> '{appSchedule,scheduleType}')::jsonb,
true
);
delete from apps_extension_time_series;

View File

@ -67,12 +67,3 @@ ALTER TABLE user_entity ADD INDEX index_user_entity_deleted(nameHash, deleted);
ALTER TABLE apps_extension_time_series ADD INDEX apps_extension_time_series_index(appId);
ALTER TABLE suggestions ADD INDEX index_suggestions_type(suggestionType);
ALTER TABLE suggestions ADD INDEX index_suggestions_status(status);
-- Change scheduleType to scheduleTimeline
UPDATE installed_apps
SET json = JSON_INSERT(
JSON_REMOVE(json, '$.appSchedule.scheduleType'),
'$.appSchedule.scheduleTimeline',
JSON_EXTRACT(json, '$.appSchedule.scheduleType')
);
delete from apps_extension_time_series;

View File

@ -66,13 +66,3 @@ CREATE INDEX index_user_entity_deleted ON user_entity (nameHash, deleted);
CREATE INDEX apps_extension_time_series_index ON apps_extension_time_series (appId);
CREATE INDEX index_suggestions_type ON suggestions (suggestionType);
CREATE INDEX index_suggestions_status ON suggestions (status);
-- change scheduleType to scheduleTimeline
UPDATE installed_apps
SET json = jsonb_set(
json::jsonb #- '{appSchedule,scheduleType}',
'{appSchedule,scheduleTimeline}',
(json #> '{appSchedule,scheduleType}')::jsonb,
true
);
delete from apps_extension_time_series;