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
Copy file name to clipboardExpand all lines: sormas-backend/src/main/resources/sql/sormas_schema.sql
+17-17Lines changed: 17 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -15513,11 +15513,11 @@ ALTER TABLE testreport ADD COLUMN IF NOT EXISTS serotypetext varchar(255);
15513
15513
UPDATE testreport SET serotypetext = serotype, serotype = 'OTHER' WHERE serotype IS NOT null and serotypetext is null;
15514
15514
DO $$
15515
15515
BEGIN
15516
-
IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'testreport' AND column_name = 'genotyperesult')
15516
+
IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'testreport' AND column_name = 'genotyperesult')
15517
15517
AND NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'testreport' AND column_name = 'genotype') THEN
15518
15518
ALTER TABLE testreport RENAME COLUMN genotyperesult TO genotype;
15519
15519
END IF;
15520
-
IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'testreport' AND column_name = 'genotyperesulttext')
15520
+
IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'testreport' AND column_name = 'genotyperesulttext')
15521
15521
AND NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'testreport' AND column_name = 'genotypetext') THEN
15522
15522
ALTER TABLE testreport RENAME COLUMN genotyperesulttext TO genotypetext;
15523
15523
END IF;
@@ -15527,11 +15527,11 @@ ALTER TABLE testreport_history ADD COLUMN IF NOT EXISTS serotypetext varchar(255
15527
15527
UPDATE testreport_history SET serotypetext = serotype, serotype = 'OTHER' WHERE serotype IS NOT null and serotypetext is null;
15528
15528
DO $$
15529
15529
BEGIN
15530
-
IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'testreport_history' AND column_name = 'genotyperesult')
15530
+
IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'testreport_history' AND column_name = 'genotyperesult')
15531
15531
AND NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'testreport_history' AND column_name = 'genotype') THEN
15532
15532
ALTER TABLE testreport_history RENAME COLUMN genotyperesult TO genotype;
15533
15533
END IF;
15534
-
IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'testreport_history' AND column_name = 'genotyperesulttext')
15534
+
IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'testreport_history' AND column_name = 'genotyperesulttext')
15535
15535
AND NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'testreport_history' AND column_name = 'genotypetext') THEN
15536
15536
ALTER TABLE testreport_history RENAME COLUMN genotyperesulttext TO genotypetext;
15537
15537
END IF;
@@ -15550,7 +15550,7 @@ alter table exposures_contactfactors add constraint exposures_contactfactors_pk
15550
15550
DROP TRIGGER IF EXISTS delete_history_trigger ON exposures_contactfactors;
15551
15551
15552
15552
alter table exposures_protectivemeasures drop constraint unq_exposures_protectivemeasures_0;
15553
-
alter table exposures_protectivemeasures add constraint exposures_protectivemeasures_pk primary key (exposure_id, protectivemeasure);
15553
+
alter table exposures_protectivemeasures add constraint exposures_protectivemeasures_pk primary key (exposure_id, protectivemeasure);
15554
15554
DROP TRIGGER IF EXISTS delete_history_trigger ON exposures_protectivemeasures;
15555
15555
15556
15556
INSERT INTO schema_version (version_number, comment) VALUES (617, '#13887 update keys and drop delete history triggers for new exposures tables');
@@ -15598,20 +15598,20 @@ CREATE TABLE IF NOT EXISTS customizablefieldmetadata (
15598
15598
15599
15599
change_user_id bigint,
15600
15600
sys_period tstzrange NOT NULL,
15601
-
15601
+
15602
15602
PRIMARY KEY (id),
15603
15603
UNIQUE(name, contextClass)
15604
15604
);
15605
15605
15606
-
CREATE INDEX idx_customizablefieldmetadata_uuid
15606
+
CREATE INDEX idx_customizablefieldmetadata_uuid
15607
15607
ON customizablefieldmetadata (uuid);
15608
-
CREATE INDEX idx_customizablefieldmetadata_contextClass
15608
+
CREATE INDEX idx_customizablefieldmetadata_contextClass
15609
15609
ON customizablefieldmetadata (contextClass);
15610
-
CREATE INDEX idx_customizablefieldmetadata_uiGroup
15610
+
CREATE INDEX idx_customizablefieldmetadata_uiGroup
15611
15611
ON customizablefieldmetadata (uiGroup);
15612
-
CREATE INDEX idx_customizablefieldmetadata_active
15612
+
CREATE INDEX idx_customizablefieldmetadata_active
15613
15613
ON customizablefieldmetadata (active);
15614
-
CREATE INDEX idx_customizablefieldmetadata_deleted
15614
+
CREATE INDEX idx_customizablefieldmetadata_deleted
15615
15615
ON customizablefieldmetadata (deleted);
15616
15616
15617
15617
ALTER TABLE customizablefieldmetadata OWNER TO sormas_user;
@@ -15662,20 +15662,20 @@ CREATE TABLE IF NOT EXISTS customizablefieldvalue (
0 commit comments