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
+32-1Lines changed: 32 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -15507,4 +15507,35 @@ ALTER TABLE healthconditions_history ADD COLUMN IF NOT EXISTS malaria varchar(25
15507
15507
ALTER TABLE healthconditions_history ADD COLUMN IF NOT EXISTS malariainfectedyear integer ;
15508
15508
15509
15509
INSERT INTO schema_version (version_number, comment) VALUES (615, '#13801, #13814 - Malaria and Dengue sampel changes');
15510
-
-- *** Insert new sql commands BEFORE this line. Remember to always consider _history tables. ***
15510
+
15511
+
-- 07-04-2026 Test report new fields related to Malaria and Dengue samples and pathogenform.
15512
+
ALTER TABLE testreport ADD COLUMN IF NOT EXISTS serotypetext varchar(255);
15513
+
UPDATE testreport SET serotypetext = serotype, serotype = 'OTHER' WHERE serotype IS NOT null and serotypetext is null;
15514
+
DO $$
15515
+
BEGIN
15516
+
IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'testreport' AND column_name = 'genotyperesult')
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
+
ALTER TABLE testreport RENAME COLUMN genotyperesult TO genotype;
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')
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
+
ALTER TABLE testreport RENAME COLUMN genotyperesulttext TO genotypetext;
15523
+
END IF;
15524
+
END $$;
15525
+
15526
+
ALTER TABLE testreport_history ADD COLUMN IF NOT EXISTS serotypetext varchar(255);
15527
+
UPDATE testreport_history SET serotypetext = serotype, serotype = 'OTHER' WHERE serotype IS NOT null and serotypetext is null;
15528
+
DO $$
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')
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
+
ALTER TABLE testreport_history RENAME COLUMN genotyperesult TO genotype;
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')
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
+
ALTER TABLE testreport_history RENAME COLUMN genotyperesulttext TO genotypetext;
15537
+
END IF;
15538
+
END $$;
15539
+
15540
+
INSERT INTO schema_version (version_number, comment) VALUES (616, '#13801, #13814 - Malaria and Dengue TestReport columns renames');
15541
+
-- *** Insert new sql commands BEFORE this line. Remember to always consider _history tables. ***
0 commit comments