You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 5, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: sormas-backend/src/main/resources/sql/sormas_schema.sql
+9-27Lines changed: 9 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -6179,20 +6179,11 @@ ALTER TABLE action_history ALTER COLUMN reply TYPE text;
6179
6179
INSERT INTO schema_version (version_number, comment) VALUES (301, 'Change action''s columns description and reply type from varchar to text #3848');
6180
6180
6181
6181
-- 2020-12-03 Remove hospital from event's type of place #3617
6182
-
UPDATE location
6183
-
SET facilitytype ='HOSPITAL'
6184
-
FROM location AS l
6185
-
INNER JOIN events ONevents.eventlocation_id=l.id
6186
-
WHEREevents.typeofplace='HOSPITAL'
6187
-
ANDl.facilitytype IS NULL;
6182
+
-- 2021-01-28 [Hotfix] Fixed migration code setting facility type for all locations in the system #4120
6183
+
UPDATE location SET facilitytype ='HOSPITAL'WHERE facilitytype IS NULLAND (SELECT typeofplace FROM events WHERE eventlocation_id =location.id) ='HOSPITAL';
6184
+
UPDATE events SET typeofplace ='FACILITY'WHERE (SELECT facilitytype FROM location WHERE id =events.eventlocation_id) IS NOT NULL;
@@ -6265,20 +6256,11 @@ CREATE INDEX IF NOT EXISTS idx_events_superordinateevent_id ON events USING hash
6265
6256
INSERT INTO schema_version (version_number, comment) VALUES (308, 'Add superordinate event to events #4020');
6266
6257
6267
6258
-- 2020-12-03 Remove hospital from exposure type of places #3680
6268
-
UPDATE location
6269
-
SET facilitytype ='HOSPITAL'
6270
-
FROM location AS l
6271
-
INNER JOIN exposures ONexposures.location_id=l.id
6272
-
WHEREexposures.typeofplace='HOSPITAL'
6273
-
ANDl.facilitytype IS NULL;
6274
-
6275
-
UPDATE exposures
6276
-
SET typeofplace ='FACILITY'
6277
-
FROM exposures as e
6278
-
INNER JOIN location ONlocation.id=e.location_id
6279
-
WHERElocation.facilitytypeIS NOT NULL;
6280
-
6281
-
INSERT INTO schema_version (version_number, comment) VALUES (309, 'Remove hospital from exposure type of places #3680');
6259
+
-- 2021-01-28 [Hotfix] Fixed migration code setting facility type for all locations in the system #4120
6260
+
UPDATE location SET facilitytype ='HOSPITAL'WHERE facilitytype IS NULLAND (SELECT typeofplace FROM exposures WHERE location_id =location.id) ='HOSPITAL';
6261
+
UPDATE exposures SET typeofplace ='FACILITY'WHERE (SELECT facilitytype FROM location WHERE id =exposures.location_id) IS NOT NULL;
6262
+
6263
+
INSERT INTO schema_version (version_number, comment) VALUES (309, 'Remove hospital from exposure type of places #3680, #4120');
0 commit comments