-- *********************************************************************
-- Update Database Script
-- *********************************************************************
-- Change Log: /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/upgrade/upgrade.changelog-up-to-1.12.3.xml
-- Ran at: 03/04/20 12:06
-- Against: SA@jdbc:h2:/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/incremental-upgrade-database/squash-tm
-- Liquibase version: 2.0.5
-- *********************************************************************

-- Lock Database
-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.12.3.xml::tm-1.12.3::bsiri::(Checksum: 3:a478ad13ba18ae010a18113c11d60f0e)
-- Update TM database version number
UPDATE CORE_CONFIG SET VALUE = '1.12.3' WHERE STR_KEY = 'squashtest.tm.database.version';

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Update TM database version number', NOW(), 'Update Data', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.12.3.xml', 'tm-1.12.3', '2.0.5', '3:a478ad13ba18ae010a18113c11d60f0e', 356);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.12.3.xml::tm-1.12.3-issue-5965-2-1::bsiri::(Checksum: 3:1fa085655cb0d45f79180ec2f08f5d7a)
-- now we can add the unique constraints on the closure tables
ALTER TABLE TCLN_RELATIONSHIP_CLOSURE ADD CONSTRAINT uniq_tcln_clos UNIQUE (ancestor_id, descendant_id);

ALTER TABLE RLN_RELATIONSHIP_CLOSURE ADD CONSTRAINT uniq_rln_clos UNIQUE (ancestor_id, descendant_id);

ALTER TABLE CLN_RELATIONSHIP_CLOSURE ADD CONSTRAINT uniq_cln_clos UNIQUE (ancestor_id, descendant_id);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'now we can add the unique constraints on the closure tables', NOW(), 'Add Unique Constraint (x3)', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.12.3.xml', 'tm-1.12.3-issue-5965-2-1', '2.0.5', '3:1fa085655cb0d45f79180ec2f08f5d7a', 357);

-- Release Database Lock
-- Release Database Lock
