--  *********************************************************************
--  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.4.1.xml
--  Ran at: 03/04/20 12:06
--  Against: squashtest_adm@localhost@jdbc:mysql://localhost:3306/squashtest_maint
--  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.4.1.xml::tm-1.4.1.00::mpagnon::(Checksum: 3:b37d19668e368b6ee87bbfb67d57268a)
--  Adds a TM database version number
UPDATE `CORE_CONFIG` SET `STR_KEY` = 'squashtest.tm.database.version', `VALUE` = '1.4.1' WHERE STR_KEY = 'squashtest.tm.database.version';

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('mpagnon', 'Adds a 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.4.1.xml', 'tm-1.4.1.00', '2.0.5', '3:b37d19668e368b6ee87bbfb67d57268a', 182);

--  Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.4.1.xml::tm-1.4.1.issue-1864-01::mpagnon::(Checksum: 3:e85391a9baa4b3fb216c065df7314754)
--  fixed database integrity for execution importance
update EXECUTION exe
			set importance = 'LOW'
			where exe.importance <>
			'LOW'
			and exe.importance <> 'HIGH'
			and exe.importance <>
			'MEDIUM'
			and exe.importance <> 'VERY_HIGH';

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('mpagnon', 'fixed database integrity for execution importance', NOW(), 'Custom SQL', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.4.1.xml', 'tm-1.4.1.issue-1864-01', '2.0.5', '3:e85391a9baa4b3fb216c065df7314754', 183);

--  Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.4.1.xml::tm-1.4.1.issue-1864-02::mpagnon::(Checksum: 3:08780dc3dfe52747bff4119bf0b7cccd)
--  fixed database integrity for execution tc_nature
update EXECUTION exe
			set tc_nature = 'UNDEFINED'
			where exe.tc_nature <>
			'ATDD'
			and exe.tc_nature <> 'BUSINESS_TESTING'
			and exe.tc_nature <> 'FUNCTIONAL_TESTING'
			and exe.tc_nature <> 'NON_FUNCTIONAL_TESTING'
			and exe.tc_nature <> 'PERFORMANCE_TESTING'
			and exe.tc_nature <> 'SECURITY_TESTING'
			and exe.tc_nature <> 'UNDEFINED'
			and exe.tc_nature <> 'USER_TESTING';

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('mpagnon', 'fixed database integrity for execution tc_nature', NOW(), 'Custom SQL', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.4.1.xml', 'tm-1.4.1.issue-1864-02', '2.0.5', '3:08780dc3dfe52747bff4119bf0b7cccd', 184);

--  Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.4.1.xml::tm-1.4.1.issue-1864-03::mpagnon::(Checksum: 3:4257292a1081cc6f06ad1ac43ae324b5)
--  fixed database integrity for execution tc_type
update EXECUTION exe
			set tc_type = 'UNDEFINED'
			where exe.tc_type <>
			'COMPLIANCE_TESTING'
			and exe.tc_type <> 'CORRECTION_TESTING'
			and exe.tc_type <> 'END_TO_END_TESTING'
			and exe.tc_type <> 'EVOLUTION_TESTING'
			and exe.tc_type <> 'PARTNER_TESTING'
			and exe.tc_type <> 'REGRESSION_TESTING'
			and exe.tc_type <> 'UNDEFINED';

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('mpagnon', 'fixed database integrity for execution tc_type', NOW(), 'Custom SQL', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.4.1.xml', 'tm-1.4.1.issue-1864-03', '2.0.5', '3:4257292a1081cc6f06ad1ac43ae324b5', 185);

--  Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.4.1.xml::tm-1.4.1.issue-1864-04::mpagnon::(Checksum: 3:e84cc2e8f2b57d7a3fd2d91f4bfff9fc)
--  fixed database integrity for execution tc_status
update EXECUTION exe
			set tc_status = 'WORK_IN_PROGRESS'
			where exe.tc_status
			<> 'APPROVED'
			and exe.tc_status <> 'OBSOLETE'
			and exe.tc_status <> 'TO_BE_UPDATED'
			and exe.tc_status <> 'UNDER_REVIEW'
			and exe.tc_status <> 'WORK_IN_PROGRESS';

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('mpagnon', 'fixed database integrity for execution tc_status', NOW(), 'Custom SQL', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.4.1.xml', 'tm-1.4.1.issue-1864-04', '2.0.5', '3:e84cc2e8f2b57d7a3fd2d91f4bfff9fc', 186);

--  Release Database Lock
--  Release Database Lock
