--  *********************************************************************
--  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.18.0.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.18.0.xml::tm-1.18.0::jthebault::(Checksum: 3:47ac35d6939b1e4c9d90e0ba418a4c9b)
--  Update TM database version number
UPDATE `CORE_CONFIG` SET `VALUE` = '1.18.0' WHERE STR_KEY = 'squashtest.tm.database.version';

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('jthebault', '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.18.0.xml', 'tm-1.18.0', '2.0.5', '3:47ac35d6939b1e4c9d90e0ba418a4c9b', 414);

--  Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml::tm-1.18.0-connection-log-table::aguilhem::(Checksum: 3:3ce3084744351755dfee9d7ea37c4d88)
--  Create Connection Attempt Log Table
CREATE TABLE `CONNECTION_ATTEMPT_LOG` (`ATTEMPT_ID` BIGINT AUTO_INCREMENT NOT NULL, `LOGIN` VARCHAR(50) NULL, `CONNECTION_DATE` DATETIME NOT NULL, `SUCCESS` TINYINT(1) NOT NULL, CONSTRAINT `PK_CONNECTION_ATTEMPT_LOG` PRIMARY KEY (`ATTEMPT_ID`));

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('aguilhem', 'Create Connection Attempt Log Table', NOW(), 'Create Table', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml', 'tm-1.18.0-connection-log-table', '2.0.5', '3:3ce3084744351755dfee9d7ea37c4d88', 415);

--  Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml::tm-1.18.0-project-template-link::jlor::(Checksum: 3:d00607ab01c06922cbb7ce367e162848)
--  Adding a column to keep the link between a Project and a Project Template
ALTER TABLE `PROJECT` ADD `TEMPLATE_ID` BIGINT;

ALTER TABLE `PROJECT` ADD CONSTRAINT `fk_project_template_id` FOREIGN KEY (`TEMPLATE_ID`) REFERENCES `PROJECT` (`PROJECT_ID`);

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('jlor', 'Adding a column to keep the link between a Project and a Project Template', NOW(), 'Add Column', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml', 'tm-1.18.0-project-template-link', '2.0.5', '3:d00607ab01c06922cbb7ce367e162848', 416);

--  Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml::tm-1.18.0-feature-7183.1-mysql::jprioux::(Checksum: 3:a162836f8bda137a8cbfdaad79c34f72)
--  mysql - add unique constraint for ordered list : test case steps

create table TEST_CASE_STEPS_TMP
                    (select TEST_CASE_ID, STEP_ID, min(STEP_ORDER) STEP_ORDER
                       from TEST_CASE_STEPS
                   group by TEST_CASE_ID, STEP_ID);

create index idx1 on TEST_CASE_STEPS_TMP(TEST_CASE_ID,STEP_ID);

update TEST_CASE_STEPS_TMP t1,
              (select TEST_CASE_ID, STEP_ID, (select count(*)
                                     from TEST_CASE_STEPS_TMP b
                                    where a.TEST_CASE_ID = b.TEST_CASE_ID
                                      and a.STEP_ORDER >= b.STEP_ORDER) ligne
                 from TEST_CASE_STEPS_TMP a) t2
        set t1.STEP_ORDER = t2.ligne - 1
         where t1.TEST_CASE_ID = t2.TEST_CASE_ID and t1.STEP_ID = t2.STEP_ID;

truncate table TEST_CASE_STEPS;

insert into TEST_CASE_STEPS
        select a.TEST_CASE_ID, a.STEP_ID,
               a.STEP_ORDER + 1 - (select count(*) from TEST_CASE_STEPS_TMP b
                                where a.TEST_CASE_ID = b.TEST_CASE_ID
                                  and a.STEP_ORDER = b.STEP_ORDER
                                  and a.STEP_ID <= b.STEP_ID
                             group by b.TEST_CASE_ID, b.STEP_ORDER) STEP_ORDER
          from TEST_CASE_STEPS_TMP a;

drop table TEST_CASE_STEPS_TMP;

ALTER TABLE `TEST_CASE_STEPS` ADD CONSTRAINT `uc_test_case_steps_order` UNIQUE (`TEST_CASE_ID`, `STEP_ORDER`);

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('jprioux', 'mysql - add unique constraint for ordered list : test case steps', NOW(), 'Custom SQL, Add Unique Constraint', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml', 'tm-1.18.0-feature-7183.1-mysql', '2.0.5', '3:a162836f8bda137a8cbfdaad79c34f72', 417);

--  Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml::tm-1.18.0-feature-7183.2-mysql::jprioux::(Checksum: 3:b8e3d458f2108b0b06689eb8a8bb012a)
--  mysql - add unique constraint for ordered list : tcs in iteration

create table ITEM_TEST_PLAN_LIST_TMP
                    (select ITERATION_ID, ITEM_TEST_PLAN_ID, min(ITEM_TEST_PLAN_ORDER) ITEM_TEST_PLAN_ORDER
                       from ITEM_TEST_PLAN_LIST
                   group by ITERATION_ID, ITEM_TEST_PLAN_ID);

create index idx2 on ITEM_TEST_PLAN_LIST_TMP(ITERATION_ID, ITEM_TEST_PLAN_ID);

update ITEM_TEST_PLAN_LIST_TMP t1,
              (select ITERATION_ID, ITEM_TEST_PLAN_ID, (select count(*)
                                     from ITEM_TEST_PLAN_LIST_TMP b
                                    where a.ITERATION_ID = b.ITERATION_ID
                                      and a.ITEM_TEST_PLAN_ORDER >= b.ITEM_TEST_PLAN_ORDER) ligne
                 from ITEM_TEST_PLAN_LIST_TMP a) t2
        set t1.ITEM_TEST_PLAN_ORDER = t2.ligne - 1
         where t1.ITERATION_ID = t2.ITERATION_ID and t1.ITEM_TEST_PLAN_ID = t2.ITEM_TEST_PLAN_ID;

truncate table ITEM_TEST_PLAN_LIST;

insert into ITEM_TEST_PLAN_LIST
        select a.ITERATION_ID, a.ITEM_TEST_PLAN_ID,
               a.ITEM_TEST_PLAN_ORDER + 1 - (select count(*) from ITEM_TEST_PLAN_LIST_TMP b
                                where a.ITERATION_ID = b.ITERATION_ID
                                  and a.ITEM_TEST_PLAN_ORDER = b.ITEM_TEST_PLAN_ORDER
                                  and a.ITEM_TEST_PLAN_ID <= b.ITEM_TEST_PLAN_ID
                             group by b.ITERATION_ID, b.ITEM_TEST_PLAN_ORDER) ITEM_TEST_PLAN_ORDER
          from ITEM_TEST_PLAN_LIST_TMP a;

drop table ITEM_TEST_PLAN_LIST_TMP;

ALTER TABLE `ITEM_TEST_PLAN_LIST` ADD CONSTRAINT `uc_item_test_plan_list_order` UNIQUE (`ITERATION_ID`, `ITEM_TEST_PLAN_ORDER`);

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('jprioux', 'mysql - add unique constraint for ordered list : tcs in iteration', NOW(), 'Custom SQL, Add Unique Constraint', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml', 'tm-1.18.0-feature-7183.2-mysql', '2.0.5', '3:b8e3d458f2108b0b06689eb8a8bb012a', 418);

--  Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml::tm-1.18.0-feature-7183.3-mysql::jprioux::(Checksum: 3:3289955f19af0d6f3b2c9e0dfbd45c15)
--  mysql - add unique constraint for ordered list : tcs in test suite

create table TEST_SUITE_TEST_PLAN_ITEM_TMP
                    (select SUITE_ID, TPI_ID, min(TEST_PLAN_ORDER) TEST_PLAN_ORDER
                       from TEST_SUITE_TEST_PLAN_ITEM
                   group by SUITE_ID, TPI_ID);

create index idx2 on TEST_SUITE_TEST_PLAN_ITEM_TMP(SUITE_ID, TPI_ID);

update TEST_SUITE_TEST_PLAN_ITEM_TMP t1,
              (select SUITE_ID, TPI_ID, (select count(*)
                                     from TEST_SUITE_TEST_PLAN_ITEM_TMP b
                                    where a.SUITE_ID = b.SUITE_ID
                                      and a.TEST_PLAN_ORDER >= b.TEST_PLAN_ORDER) ligne
                 from TEST_SUITE_TEST_PLAN_ITEM_TMP a) t2
        set t1.TEST_PLAN_ORDER = t2.ligne - 1
         where t1.SUITE_ID = t2.SUITE_ID and t1.TPI_ID = t2.TPI_ID;

truncate table TEST_SUITE_TEST_PLAN_ITEM;

insert into TEST_SUITE_TEST_PLAN_ITEM
        select a.TPI_ID, a.SUITE_ID,
               a.TEST_PLAN_ORDER + 1 - (select count(*) from TEST_SUITE_TEST_PLAN_ITEM_TMP b
                                where a.SUITE_ID = b.SUITE_ID
                                  and a.TEST_PLAN_ORDER = b.TEST_PLAN_ORDER
                                  and a.TPI_ID <= b.TPI_ID
                             group by b.SUITE_ID, b.TEST_PLAN_ORDER) TEST_PLAN_ORDER
          from TEST_SUITE_TEST_PLAN_ITEM_TMP a;

drop table TEST_SUITE_TEST_PLAN_ITEM_TMP;

ALTER TABLE `TEST_SUITE_TEST_PLAN_ITEM` ADD CONSTRAINT `uc_test_suite_test_plan_item_order` UNIQUE (`SUITE_ID`, `TEST_PLAN_ORDER`);

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('jprioux', 'mysql - add unique constraint for ordered list : tcs in test suite', NOW(), 'Custom SQL, Add Unique Constraint', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml', 'tm-1.18.0-feature-7183.3-mysql', '2.0.5', '3:3289955f19af0d6f3b2c9e0dfbd45c15', 419);

--  Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml::tm-1.18.0-feature-7183.4-mysql::jprioux::(Checksum: 3:748396a27144ec4fe4315787c155c1de)
--  mysql - add unique constraint for ordered list : tcs in campaign

create table CAMPAIGN_TEST_PLAN_ITEM_TMP
                    (select CTPI_ID, CAMPAIGN_ID, TEST_CASE_ID, USER_ID, min(TEST_PLAN_ORDER) TEST_PLAN_ORDER, DATASET_ID
                       from CAMPAIGN_TEST_PLAN_ITEM
                   group by CAMPAIGN_ID, CTPI_ID);

create index idx2 on CAMPAIGN_TEST_PLAN_ITEM_TMP(CAMPAIGN_ID, CTPI_ID);

update CAMPAIGN_TEST_PLAN_ITEM_TMP t1,
              (select CTPI_ID, CAMPAIGN_ID, TEST_CASE_ID, USER_ID, (select count(*)
                                     from CAMPAIGN_TEST_PLAN_ITEM_TMP b
                                    where a.CAMPAIGN_ID = b.CAMPAIGN_ID
                                      and a.TEST_PLAN_ORDER >= b.TEST_PLAN_ORDER) ligne, DATASET_ID
                 from CAMPAIGN_TEST_PLAN_ITEM_TMP a) t2
        set t1.TEST_PLAN_ORDER = t2.ligne - 1
         where t1.CAMPAIGN_ID = t2.CAMPAIGN_ID and t1.CTPI_ID = t2.CTPI_ID;

truncate table CAMPAIGN_TEST_PLAN_ITEM;

insert into CAMPAIGN_TEST_PLAN_ITEM
        select a.CTPI_ID, a.CAMPAIGN_ID, a.TEST_CASE_ID, a.USER_ID,
               a.TEST_PLAN_ORDER + 1 - (select count(*) from CAMPAIGN_TEST_PLAN_ITEM_TMP b
                                where a.CAMPAIGN_ID = b.CAMPAIGN_ID
                                  and a.TEST_PLAN_ORDER = b.TEST_PLAN_ORDER
                                  and a.CTPI_ID <= b.CTPI_ID
                             group by b.CAMPAIGN_ID, b.TEST_PLAN_ORDER) TEST_PLAN_ORDER, a.DATASET_ID
          from CAMPAIGN_TEST_PLAN_ITEM_TMP a;

drop table CAMPAIGN_TEST_PLAN_ITEM_TMP;

ALTER TABLE `CAMPAIGN_TEST_PLAN_ITEM` ADD CONSTRAINT `uc_campaign_test_plan_item_order` UNIQUE (`CAMPAIGN_ID`, `TEST_PLAN_ORDER`);

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('jprioux', 'mysql - add unique constraint for ordered list : tcs in campaign', NOW(), 'Custom SQL, Add Unique Constraint', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml', 'tm-1.18.0-feature-7183.4-mysql', '2.0.5', '3:748396a27144ec4fe4315787c155c1de', 420);

--  Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml::tm-1.18.0-binding-report-to-dashboard::zyang::(Checksum: 3:2bd818310301c4e63ce1d8780b49c334)
CREATE TABLE `CUSTOM_REPORT_REPORT_BINDING` (`CRRB_ID` BIGINT AUTO_INCREMENT NOT NULL, `CRD_ID` BIGINT NOT NULL, `REPORT_ID` BIGINT NOT NULL, `ROW` INT NULL, `COL` INT NULL, `SIZE_X` INT NULL, `SIZE_Y` INT NULL, CONSTRAINT `PK_CRRB_ID` PRIMARY KEY (`CRRB_ID`), CONSTRAINT `fk_chart_bindind_report_definition_report_id` FOREIGN KEY (`REPORT_ID`) REFERENCES REPORT_DEFINITION(REPORT_ID), CONSTRAINT `fk_report_bindind_custom_report_dashboard_crd_id` FOREIGN KEY (`CRD_ID`) REFERENCES CUSTOM_REPORT_DASHBOARD(CRD_ID));

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('zyang', '', NOW(), 'Create Table', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml', 'tm-1.18.0-binding-report-to-dashboard', '2.0.5', '3:2bd818310301c4e63ce1d8780b49c334', 421);

--  Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml::tm-1.18.0-scripted-test-case::jthebault::(Checksum: 3:1a7f2b2e849f647de429bbc7947f7d31)
--  Create the scripted execution table
CREATE TABLE `SCRIPTED_TC_EXTENDER` (`SCRIPTED_TC_EXTENDER_ID` BIGINT AUTO_INCREMENT NOT NULL, `SCRIPT` LONGTEXT NULL, `LANGUAGE` VARCHAR(50) NULL, `TEST_CASE_ID` BIGINT NOT NULL, CONSTRAINT `PK_SCRIPTED_TC_EXTENDER` PRIMARY KEY (`SCRIPTED_TC_EXTENDER_ID`), CONSTRAINT `fk_scripted_extender_test_case` FOREIGN KEY (`TEST_CASE_ID`) REFERENCES TEST_CASE(TCLN_ID));

CREATE INDEX `scripted_tc_extender_test_case_id_idx` ON `SCRIPTED_TC_EXTENDER`(`TEST_CASE_ID`);

CREATE TABLE `SCRIPTED_EXECUTION_EXTENDER` (`SCRIPTED_EXECUTION_EXTENDER_ID` BIGINT AUTO_INCREMENT NOT NULL, `LANGUAGE` VARCHAR(50) NULL, `SCRIPT_NAME` VARCHAR(255) NULL, `EXECUTION_ID` BIGINT NOT NULL, CONSTRAINT `PK_SCRIPTED_EXECUTION_EXTENDER` PRIMARY KEY (`SCRIPTED_EXECUTION_EXTENDER_ID`), CONSTRAINT `fk_scripted_extender_execution` FOREIGN KEY (`EXECUTION_ID`) REFERENCES EXECUTION(EXECUTION_ID));

CREATE INDEX `scripted_execution_extender_execution_id_idx` ON `SCRIPTED_EXECUTION_EXTENDER`(`EXECUTION_ID`);

ALTER TABLE `TEST_CASE` ADD `TC_KIND` VARCHAR(30) NOT NULL DEFAULT 'STANDARD';

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('jthebault', 'Create the scripted execution table', NOW(), 'Create Table, Create Index, Create Table, Create Index, Add Column', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml', 'tm-1.18.0-scripted-test-case', '2.0.5', '3:1a7f2b2e849f647de429bbc7947f7d31', 422);

--  Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml::tm-1.18.0-modification-report::zyang::(Checksum: 3:438a13a6179b54a364f0ff2e2bb6fc15)
--  Adds a summary field to report definition
ALTER TABLE `REPORT_DEFINITION` ADD `SUMMARY` VARCHAR(255) NOT NULL DEFAULT '';

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('zyang', 'Adds a summary field to report definition', NOW(), 'Add Column', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml', 'tm-1.18.0-modification-report', '2.0.5', '3:438a13a6179b54a364f0ff2e2bb6fc15', 423);

--  Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml::tm-1.18.0-oauth1a-consumer-1::bsiri::(Checksum: 3:e0c4d5016ade1c0d4da3bfbdf4dfe414)
--  StoredCredentials can now store either credentials, either general configuration.
--          A new column appear so we can hint what is the type of the payload.
--          Also, users can now have stored credentials (even though they can't manage them yet).
--          Only one credentials can be created for a given user and a given server (bugtracker)
ALTER TABLE `STORED_CREDENTIALS` ADD `CONTENT_TYPE` VARCHAR(4) DEFAULT 'CRED';

ALTER TABLE `STORED_CREDENTIALS` ADD `AUTHENTICATED_USER` BIGINT DEFAULT null;

ALTER TABLE `STORED_CREDENTIALS` ADD CONSTRAINT `fk_stored_credentials_user` FOREIGN KEY (`AUTHENTICATED_USER`) REFERENCES `CORE_USER` (`PARTY_ID`);

ALTER TABLE `STORED_CREDENTIALS` ADD CONSTRAINT `uniq_stored_credentials_server_user` UNIQUE (`AUTHENTICATED_SERVER`, `AUTHENTICATED_USER`, `CONTENT_TYPE`);

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('bsiri', 'StoredCredentials can now store either credentials, either general configuration.
        A new column appear so we can hint what is the type of the payload.
        Also, users can now have stored credentials (even though they can''t manage them yet).
...', NOW(), 'Add Column, Add Unique Constraint', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml', 'tm-1.18.0-oauth1a-consumer-1', '2.0.5', '3:e0c4d5016ade1c0d4da3bfbdf4dfe414', 424);

--  Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml::tm-1.18.0-oauth1a-consumer-2::bsiri::(Checksum: 3:ef39e53abfeb94877814ea110d50494b)
--  Bugtracker now declare which authentication protocol should be used upfront.
ALTER TABLE `BUGTRACKER` ADD `AUTH_PROTOCOL` VARCHAR(30) NOT NULL DEFAULT 'BASIC_AUTH';

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('bsiri', 'Bugtracker now declare which authentication protocol should be used upfront.', NOW(), 'Add Column', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml', 'tm-1.18.0-oauth1a-consumer-2', '2.0.5', '3:ef39e53abfeb94877814ea110d50494b', 425);

--  Changeset /var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml::tm-1.18.0-email-column-resizing::aguilhem::(Checksum: 3:5674ed3ebb19808b8a48c27799023f4a)
ALTER TABLE `CORE_USER` MODIFY `EMAIL` VARCHAR(255);

ALTER TABLE `CORE_USER` ALTER `EMAIL` SET DEFAULT '';

INSERT INTO `DATABASECHANGELOG` (`AUTHOR`, `COMMENTS`, `DATEEXECUTED`, `DESCRIPTION`, `EXECTYPE`, `FILENAME`, `ID`, `LIQUIBASE`, `MD5SUM`, `ORDEREXECUTED`) VALUES ('aguilhem', '', NOW(), 'Modify data type, Add Default Value', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros-1.21/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-1.18.0.xml', 'tm-1.18.0-email-column-resizing', '2.0.5', '3:5674ed3ebb19808b8a48c27799023f4a', 426);

--  Release Database Lock
--  Release Database Lock
