-- *********************************************************************
-- 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-0.23.0.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-0.23.0.xml::tm-0.23.0.01::bsiri::(Checksum: 3:4c7a622b9ce59f63f8a353974546e243)
-- remove ProjectManager and TestRunner from the ACL permission table
delete from ACL_GROUP_PERMISSION where ACL_GROUP_ID in 
			(select id from ACL_GROUP where qualified_name='squashtest.acl.group.tm.ProjectManager' 
			or qualified_name='squashtest.acl.group.tm.TestRunner');

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'remove ProjectManager and TestRunner from the ACL permission table', NOW(), 'Custom SQL', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.23.0.xml', 'tm-0.23.0.01', '2.0.5', '3:4c7a622b9ce59f63f8a353974546e243', 75);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.23.0.xml::tm-0.23.0.02::bsiri::(Checksum: 3:0d9176e53082f38f2505081b41416b75)
-- all users that were ProjectManager or TestRunner on anything are now TestEditor
update ACL_RESPONSIBILITY_SCOPE_ENTRY
			set ACL_GROUP_ID = (select id from ACL_GROUP where qualified_name='squashtest.acl.group.tm.TestEditor')
			where ACL_GROUP_ID in (select id from ACL_GROUP where qualified_name='squashtest.acl.group.tm.ProjectManager' 
									or qualified_name='squashtest.acl.group.tm.TestRunner');

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'all users that were ProjectManager or TestRunner on anything are now TestEditor', NOW(), 'Custom SQL', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.23.0.xml', 'tm-0.23.0.02', '2.0.5', '3:0d9176e53082f38f2505081b41416b75', 76);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.23.0.xml::tm-0.23.0.03::bsiri::(Checksum: 3:8de0f418634703a9aa5c73e391db6471)
-- remove ProjectManager and TestRunner from the existing acl groups
delete from ACL_GROUP
			where qualified_name='squashtest.acl.group.tm.ProjectManager' 
			or qualified_name='squashtest.acl.group.tm.TestRunner';

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'remove ProjectManager and TestRunner from the existing acl groups', NOW(), 'Custom SQL', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.23.0.xml', 'tm-0.23.0.03', '2.0.5', '3:8de0f418634703a9aa5c73e391db6471', 77);

-- Release Database Lock
-- Release Database Lock
