Skip to content

Commit 28ed444

Browse files
committed
revert SQL format
1 parent e737546 commit 28ed444

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

sormas-backend/src/main/resources/sql/sormas_schema.sql

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15513,11 +15513,11 @@ ALTER TABLE testreport ADD COLUMN IF NOT EXISTS serotypetext varchar(255);
1551315513
UPDATE testreport SET serotypetext = serotype, serotype = 'OTHER' WHERE serotype IS NOT null and serotypetext is null;
1551415514
DO $$
1551515515
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')
1551715517
AND NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'testreport' AND column_name = 'genotype') THEN
1551815518
ALTER TABLE testreport RENAME COLUMN genotyperesult TO genotype;
1551915519
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')
1552115521
AND NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'testreport' AND column_name = 'genotypetext') THEN
1552215522
ALTER TABLE testreport RENAME COLUMN genotyperesulttext TO genotypetext;
1552315523
END IF;
@@ -15527,11 +15527,11 @@ ALTER TABLE testreport_history ADD COLUMN IF NOT EXISTS serotypetext varchar(255
1552715527
UPDATE testreport_history SET serotypetext = serotype, serotype = 'OTHER' WHERE serotype IS NOT null and serotypetext is null;
1552815528
DO $$
1552915529
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')
1553115531
AND NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'testreport_history' AND column_name = 'genotype') THEN
1553215532
ALTER TABLE testreport_history RENAME COLUMN genotyperesult TO genotype;
1553315533
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')
1553515535
AND NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = current_schema() AND table_name = 'testreport_history' AND column_name = 'genotypetext') THEN
1553615536
ALTER TABLE testreport_history RENAME COLUMN genotyperesulttext TO genotypetext;
1553715537
END IF;
@@ -15550,7 +15550,7 @@ alter table exposures_contactfactors add constraint exposures_contactfactors_pk
1555015550
DROP TRIGGER IF EXISTS delete_history_trigger ON exposures_contactfactors;
1555115551

1555215552
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);
1555415554
DROP TRIGGER IF EXISTS delete_history_trigger ON exposures_protectivemeasures;
1555515555

1555615556
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 (
1559815598

1559915599
change_user_id bigint,
1560015600
sys_period tstzrange NOT NULL,
15601-
15601+
1560215602
PRIMARY KEY (id),
1560315603
UNIQUE(name, contextClass)
1560415604
);
1560515605

15606-
CREATE INDEX idx_customizablefieldmetadata_uuid
15606+
CREATE INDEX idx_customizablefieldmetadata_uuid
1560715607
ON customizablefieldmetadata (uuid);
15608-
CREATE INDEX idx_customizablefieldmetadata_contextClass
15608+
CREATE INDEX idx_customizablefieldmetadata_contextClass
1560915609
ON customizablefieldmetadata (contextClass);
15610-
CREATE INDEX idx_customizablefieldmetadata_uiGroup
15610+
CREATE INDEX idx_customizablefieldmetadata_uiGroup
1561115611
ON customizablefieldmetadata (uiGroup);
15612-
CREATE INDEX idx_customizablefieldmetadata_active
15612+
CREATE INDEX idx_customizablefieldmetadata_active
1561315613
ON customizablefieldmetadata (active);
15614-
CREATE INDEX idx_customizablefieldmetadata_deleted
15614+
CREATE INDEX idx_customizablefieldmetadata_deleted
1561515615
ON customizablefieldmetadata (deleted);
1561615616

1561715617
ALTER TABLE customizablefieldmetadata OWNER TO sormas_user;
@@ -15662,20 +15662,20 @@ CREATE TABLE IF NOT EXISTS customizablefieldvalue (
1566215662

1566315663
change_user_id bigint,
1566415664
sys_period tstzrange NOT NULL,
15665-
15665+
1566615666
PRIMARY KEY (id),
1566715667
UNIQUE(customizablefieldmetadata_id, entityUuid, contextClass)
1566815668
);
1566915669

15670-
CREATE INDEX idx_customizablefieldvalue_uuid
15670+
CREATE INDEX idx_customizablefieldvalue_uuid
1567115671
ON customizablefieldvalue (uuid);
15672-
CREATE INDEX idx_customizablefieldvalue_entityUuid
15672+
CREATE INDEX idx_customizablefieldvalue_entityUuid
1567315673
ON customizablefieldvalue (entityUuid);
15674-
CREATE INDEX idx_customizablefieldvalue_contextEntity
15674+
CREATE INDEX idx_customizablefieldvalue_contextEntity
1567515675
ON customizablefieldvalue (contextClass, entityUuid);
15676-
CREATE INDEX idx_customizablefieldvalue_fieldMetadata
15676+
CREATE INDEX idx_customizablefieldvalue_fieldMetadata
1567715677
ON customizablefieldvalue (customizablefieldmetadata_id);
15678-
CREATE INDEX idx_customizablefieldvalue_deleted
15678+
CREATE INDEX idx_customizablefieldvalue_deleted
1567915679
ON customizablefieldvalue (deleted);
1568015680

1568115681
ALTER TABLE customizablefieldvalue ADD CONSTRAINT fk_change_user_id FOREIGN KEY (change_user_id) REFERENCES users (id);

0 commit comments

Comments
 (0)