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

-- Lock Database
-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml::1::gfouquet::(Checksum: 3:0827c56c3da3a248891d04c6f0ddb00e)
CREATE TABLE CORE_USER (ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, LOGIN VARCHAR(50) NOT NULL, FIRST_NAME VARCHAR(50) DEFAULT '' NOT NULL, LAST_NAME VARCHAR(50) DEFAULT '' NOT NULL, EMAIL VARCHAR(50) DEFAULT '' NOT NULL, ACTIVE BOOLEAN DEFAULT FALSE NOT NULL, CREATED_BY VARCHAR(50) NOT NULL, CREATED_ON TIMESTAMP NOT NULL, LAST_MODIFIED_ON TIMESTAMP DEFAULT null, LAST_MODIFIED_BY VARCHAR(50) DEFAULT null, CONSTRAINT PK_CORE_USER PRIMARY KEY (ID), CONSTRAINT CT_UNIQUE_USER_LOGIN UNIQUE (LOGIN));

CREATE UNIQUE INDEX DX_USER_LOGIN ON CORE_USER(LOGIN);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('gfouquet', '', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml', '1', '2.0.5', '3:0827c56c3da3a248891d04c6f0ddb00e', 1);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml::2::gfouquet::(Checksum: 3:9cb7669efca04a3d97a7de885d0408fb)
CREATE TABLE CORE_GROUP (ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, QUALIFIED_NAME VARCHAR(255) NOT NULL, CONSTRAINT PK_CORE_GROUP PRIMARY KEY (ID), CONSTRAINT CT_UN_GRP_QUAL_NAME UNIQUE (QUALIFIED_NAME));

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('gfouquet', '', NOW(), 'Create Table', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml', '2', '2.0.5', '3:9cb7669efca04a3d97a7de885d0408fb', 2);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml::3::gfouquet::(Checksum: 3:9f898022aa169e6e6fe3643d9a8536e0)
CREATE TABLE CORE_GROUP_AUTHORITY (GROUP_ID BIGINT NOT NULL, AUTHORITY VARCHAR(50) NOT NULL, CONSTRAINT FK_GRP_AUTH_GRP FOREIGN KEY (GROUP_ID) REFERENCES CORE_GROUP(ID));

CREATE INDEX DX_GRP_ID ON CORE_GROUP_AUTHORITY(GROUP_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('gfouquet', '', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml', '3', '2.0.5', '3:9f898022aa169e6e6fe3643d9a8536e0', 3);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml::4::gfouquet::(Checksum: 3:12d5a7ac46a1fc80f78b4abf1e2cbbc8)
CREATE TABLE CORE_GROUP_MEMBER (USER_ID BIGINT NOT NULL, GROUP_ID BIGINT NOT NULL, CONSTRAINT FK_GRP_MEMBER_GRP FOREIGN KEY (GROUP_ID) REFERENCES CORE_GROUP(ID), CONSTRAINT FK_GRP_MEMBER_USR FOREIGN KEY (USER_ID) REFERENCES CORE_USER(ID));

CREATE UNIQUE INDEX DX_GRP_MEMBER ON CORE_GROUP_MEMBER(USER_ID, GROUP_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('gfouquet', '', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml', '4', '2.0.5', '3:12d5a7ac46a1fc80f78b4abf1e2cbbc8', 4);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml::5::gfouquet::(Checksum: 3:003d6da0a4bdceba7282faefe2e73525)
INSERT INTO CORE_GROUP (QUALIFIED_NAME) VALUES ('squashtest.authz.group.core.Admin');

INSERT INTO CORE_GROUP_AUTHORITY (AUTHORITY, GROUP_ID) VALUES ('ROLE_ADMIN', (select max(ID) from CORE_GROUP));

INSERT INTO CORE_GROUP_AUTHORITY (AUTHORITY, GROUP_ID) VALUES ('ROLE_USER', (select max(ID) from CORE_GROUP));

INSERT INTO CORE_USER (CREATED_BY, CREATED_ON, EMAIL, LAST_NAME, LOGIN) VALUES ('liquibase', CURRENT_TIMESTAMP, 'admin@squashtest.org', 'Squash Administrator', 'admin');

INSERT INTO CORE_GROUP_MEMBER (GROUP_ID, USER_ID) VALUES ((select max(ID) from CORE_GROUP), (select max(ID) from CORE_USER));

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('gfouquet', '', NOW(), 'Insert Row (x5)', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml', '5', '2.0.5', '3:003d6da0a4bdceba7282faefe2e73525', 5);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml::7::gfouquet::(Checksum: 3:2872b424d0bf771cf612c1dc63533d84)
CREATE TABLE ACL_CLASS (ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, CLASSNAME VARCHAR(255) NOT NULL, CONSTRAINT PK_ACL_CLASS PRIMARY KEY (ID), CONSTRAINT CT_UN_CLASSNAME UNIQUE (CLASSNAME));

CREATE UNIQUE INDEX DX_CLASS_NAME ON ACL_CLASS(CLASSNAME);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('gfouquet', '', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml', '7', '2.0.5', '3:2872b424d0bf771cf612c1dc63533d84', 6);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml::8::gfouquet::(Checksum: 3:2c5ed802f9f1885284157f65b772d4ae)
CREATE TABLE ACL_OBJECT_IDENTITY (ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, IDENTITY BIGINT NOT NULL, CLASS_ID BIGINT NOT NULL, CONSTRAINT PK_ACL_OBJECT_ID PRIMARY KEY (ID), CONSTRAINT FK_ACL_OBJ_ID_ACL_CLASS FOREIGN KEY (CLASS_ID) REFERENCES ACL_CLASS(ID));

ALTER TABLE ACL_OBJECT_IDENTITY ADD UNIQUE (IDENTITY, CLASS_ID);

CREATE INDEX DX_OBJ_ID_IDENTITY ON ACL_OBJECT_IDENTITY(IDENTITY);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('gfouquet', '', NOW(), 'Create Table, Add Unique Constraint, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml', '8', '2.0.5', '3:2c5ed802f9f1885284157f65b772d4ae', 7);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml::9::gfouquet::(Checksum: 3:14139425ec3263f63ca78174b6cfe960)
CREATE TABLE ACL_GROUP (ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, QUALIFIED_NAME VARCHAR(255) NOT NULL, CONSTRAINT PK_ACL_GRP PRIMARY KEY (ID), CONSTRAINT CT_UN_ACL_GRP_QUAL_NAME UNIQUE (QUALIFIED_NAME));

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('gfouquet', '', NOW(), 'Create Table', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml', '9', '2.0.5', '3:14139425ec3263f63ca78174b6cfe960', 8);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml::10::gfouquet::(Checksum: 3:fcf338b8327512d052f48426bc2b2cd4)
CREATE TABLE ACL_GROUP_PERMISSION (ACL_GROUP_ID BIGINT NOT NULL, PERMISSION_MASK INT DEFAULT 0 NOT NULL, CLASS_ID BIGINT NOT NULL, PERMISSION_ORDER INT DEFAULT 0 NOT NULL, GRANTING BOOLEAN DEFAULT TRUE NOT NULL, CONSTRAINT FK_ACL_GRP_PERMISSION_ACL_GRP FOREIGN KEY (ACL_GROUP_ID) REFERENCES ACL_GROUP(ID), CONSTRAINT FK_SC_AUTH_ACL_CLASS FOREIGN KEY (CLASS_ID) REFERENCES ACL_CLASS(ID));

ALTER TABLE ACL_GROUP_PERMISSION ADD CONSTRAINT PK_ACL_GRP_PERMISSION PRIMARY KEY (ACL_GROUP_ID, CLASS_ID, PERMISSION_MASK);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('gfouquet', '', NOW(), 'Create Table, Add Primary Key', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml', '10', '2.0.5', '3:fcf338b8327512d052f48426bc2b2cd4', 9);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml::11::gfouquet::(Checksum: 3:9ae257f0e06c96c6b7d52b475eb4af62)
CREATE TABLE ACL_RESPONSIBILITY_SCOPE_ENTRY (ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, USER_ID BIGINT NOT NULL, ACL_GROUP_ID BIGINT NOT NULL, OBJECT_IDENTITY_ID BIGINT NOT NULL, CONSTRAINT PK_RESP_SCOPE_ENTRY PRIMARY KEY (ID), CONSTRAINT FK_RESP_SCOPE_USER FOREIGN KEY (USER_ID) REFERENCES CORE_USER(ID), CONSTRAINT FK_RESP_SCOPE_OBJ_ID FOREIGN KEY (OBJECT_IDENTITY_ID) REFERENCES ACL_OBJECT_IDENTITY(ID), CONSTRAINT FK_RESP_SCOPE_ACL_GRP FOREIGN KEY (ACL_GROUP_ID) REFERENCES ACL_GROUP(ID));

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('gfouquet', '', NOW(), 'Create Table', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/core/core.changelog-0.15.0.xml', '11', '2.0.5', '3:9ae257f0e06c96c6b7d52b475eb4af62', 10);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.01::bsiri::(Checksum: 3:4e6c3f9dea5db7ce08cde70ffee4b555)
-- This table maintains the mapping between an issue in Squash and an 
-- 			issue in the remote bugtracker
CREATE TABLE ISSUE (ISSUE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, REMOTE_ISSUE_ID VARCHAR(255) NOT NULL, CONSTRAINT PK_ISSUE PRIMARY KEY (ISSUE_ID));

CREATE INDEX idx_issue ON ISSUE(ISSUE_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'This table maintains the mapping between an issue in Squash and an 
			issue in the remote bugtracker', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.01', '2.0.5', '3:4e6c3f9dea5db7ce08cde70ffee4b555', 11);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.02::bsiri::(Checksum: 3:4923e5c1de211cad8c0f4b3c771c81af)
-- each Squash entity that may be attached to one or several bugs will be given an issue list. This table will maintain that list, an entry means that some entity refering to it have several.
CREATE TABLE ISSUE_LIST (ISSUE_LIST_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, CONSTRAINT PK_ISSUE_LIST PRIMARY KEY (ISSUE_LIST_ID));

CREATE INDEX idx_issue_list ON ISSUE_LIST(ISSUE_LIST_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'each Squash entity that may be attached to one or several bugs will be given an issue list. This table will maintain that list, an entry means that some entity refering to it have several.', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.02', '2.0.5', '3:4923e5c1de211cad8c0f4b3c771c81af', 12);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.03::bsiri::(Checksum: 3:cf1b8733816e62e4fd608d629a0db0a0)
-- This table will map one issue_list to (0,several) issues
CREATE TABLE ISSUE_LIST_CONTENT (ISSUE_LIST_ID BIGINT NOT NULL, ISSUE_ID BIGINT NOT NULL, CONSTRAINT fk_list_issue_list FOREIGN KEY (ISSUE_LIST_ID) REFERENCES ISSUE_LIST(ISSUE_LIST_ID), CONSTRAINT fk_list_issue_issue FOREIGN KEY (ISSUE_ID) REFERENCES ISSUE(ISSUE_ID));

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'This table will map one issue_list to (0,several) issues', NOW(), 'Create Table', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.03', '2.0.5', '3:cf1b8733816e62e4fd608d629a0db0a0', 13);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.04::bsiri::(Checksum: 3:448ea3a7190e89f1a3d8f01f461f5af4)
-- Cette table contient le contenu d'une pièce jointe, dont les meta infos sont stockees dans la 
-- 			table ATTACHMENT. La relation entre les deux tables est 1-1
CREATE TABLE ATTACHMENT_CONTENT (ATTACHMENT_CONTENT_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, STREAM_CONTENT LONGVARBINARY DEFAULT NULL, CONSTRAINT PK_ATTACHMENT_CONTENT PRIMARY KEY (ATTACHMENT_CONTENT_ID));

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table contient le contenu d''une pièce jointe, dont les meta infos sont stockees dans la 
			table ATTACHMENT. La relation entre les deux tables est 1-1', NOW(), 'Create Table', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.04', '2.0.5', '3:448ea3a7190e89f1a3d8f01f461f5af4', 14);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.05::bsiri::(Checksum: 3:c3a74f53f543266e9664ced59749936d)
-- Cette table stockera les pieces jointes. La piece elle même est un blob stocke a part dans
-- 					la table ATTACHMENT_CONTENT. La relation entre les deux tables est 1-1
CREATE TABLE ATTACHMENT (ATTACHMENT_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, NAME VARCHAR(255) NOT NULL, TYPE VARCHAR(10) NOT NULL, SIZE BIGINT NOT NULL, ADDED_ON TIMESTAMP NOT NULL, CONTENT_ID BIGINT, CONSTRAINT PK_ATTACHMENT PRIMARY KEY (ATTACHMENT_ID), CONSTRAINT fk_attachment_content FOREIGN KEY (CONTENT_ID) REFERENCES ATTACHMENT_CONTENT(ATTACHMENT_CONTENT_ID));

CREATE INDEX idx_attachment ON ATTACHMENT(ATTACHMENT_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table stockera les pieces jointes. La piece elle même est un blob stocke a part dans
					la table ATTACHMENT_CONTENT. La relation entre les deux tables est 1-1', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.05', '2.0.5', '3:c3a74f53f543266e9664ced59749936d', 15);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.06::bsiri::(Checksum: 3:91e399d585df7a01de44b11c56ccc4b4)
-- Cette table matérialise une liste d'ATTACHMENT. Bien qu'elle ne contienne que sa clé primaire, 
-- 			sa raison d'exister est, au niveau de l'application, de fournir 'd'un point de vue technique) 
-- 			une entité indépendante des entités métier auquel on rajoute les pièces jointes (d'un point de vue métier).
CREATE TABLE ATTACHMENT_LIST (ATTACHMENT_LIST_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, CONSTRAINT PK_ATTACHMENT_LIST PRIMARY KEY (ATTACHMENT_LIST_ID));

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table matérialise une liste d''ATTACHMENT. Bien qu''elle ne contienne que sa clé primaire, 
			sa raison d''exister est, au niveau de l''application, de fournir ''d''un point de vue technique) 
			une entité indépendante des entités métier auquel on ra...', NOW(), 'Create Table', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.06', '2.0.5', '3:91e399d585df7a01de44b11c56ccc4b4', 16);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.07::bsiri::(Checksum: 3:5aafdf5b488ea626d85ef782959884d0)
-- Table d'association entre un cas de test et ses pieces jointes
CREATE TABLE ATTACHMENT_LIST_CONTENT (AL_ID BIGINT NOT NULL, ATTACHMENT_ID BIGINT NOT NULL, CONSTRAINT fk_list_attachment_list FOREIGN KEY (AL_ID) REFERENCES ATTACHMENT_LIST(ATTACHMENT_LIST_ID), CONSTRAINT fk_list_attachment_attachment FOREIGN KEY (ATTACHMENT_ID) REFERENCES ATTACHMENT(ATTACHMENT_ID));

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Table d''association entre un cas de test et ses pieces jointes', NOW(), 'Create Table', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.07', '2.0.5', '3:5aafdf5b488ea626d85ef782959884d0', 17);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.08::ramoussou::(Checksum: 3:10f6bb98e3ad8c7688581c2434dc5596)
-- Table representant les projets englobants les libraries d'entite que nous utilisons.
CREATE TABLE PROJECT (PROJECT_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, NAME VARCHAR(255) NOT NULL, DESCRIPTION LONGVARCHAR, LABEL VARCHAR(255), ACTIVE BOOLEAN DEFAULT TRUE NOT NULL, CREATED_BY VARCHAR(50) NOT NULL, CREATED_ON TIMESTAMP NOT NULL, LAST_MODIFIED_BY VARCHAR(50) DEFAULT null, LAST_MODIFIED_ON TIMESTAMP DEFAULT null, CL_ID BIGINT, TCL_ID BIGINT, RL_ID BIGINT, CONSTRAINT PK_PROJECT PRIMARY KEY (PROJECT_ID));

CREATE INDEX idx_project ON PROJECT(PROJECT_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('ramoussou', 'Table representant les projets englobants les libraries d''entite que nous utilisons.', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.08', '2.0.5', '3:10f6bb98e3ad8c7688581c2434dc5596', 18);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.09::bsiri::(Checksum: 3:6ca7c6625c398a565905e6de822b7398)
-- Cette table gere les bibliotheques de cas de test. Une bibliotheque de cas de test peut contenir plusieurs 
-- 		repertoires et/ou cas de test, ces deux entites etant regroupees sous l'appellation generique d'element de bibliotheque 
-- 		de cas de test (test case library nodes).
CREATE TABLE TEST_CASE_LIBRARY (TCL_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, PROJECT_ID BIGINT, CONSTRAINT PK_TEST_CASE_LIBRARY PRIMARY KEY (TCL_ID), CONSTRAINT fk_tcl_project FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID));

CREATE INDEX idx_test_case_library ON TEST_CASE_LIBRARY(TCL_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table gere les bibliotheques de cas de test. Une bibliotheque de cas de test peut contenir plusieurs 
		repertoires et/ou cas de test, ces deux entites etant regroupees sous l''appellation generique d''element de bibliotheque 
		de cas de test (tes...', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.09', '2.0.5', '3:6ca7c6625c398a565905e6de822b7398', 19);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.10::bsiri::(Checksum: 3:70c11ac27e2a6bb65143efee427cd28e)
-- Cette table gere les bibliotheques d'exigences. Une bibliotheque d'exigences peut contenir plusieurs repertoires 
-- 				et/ou exigences, ces deux entites etant regroupees sous l'appellation generique d'element de bibliotheque d'exigences (requirement 
-- 				library nodes).
CREATE TABLE REQUIREMENT_LIBRARY (RL_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, PROJECT_ID BIGINT, CONSTRAINT PK_REQUIREMENT_LIBRARY PRIMARY KEY (RL_ID), CONSTRAINT fk_rl_project FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID));

CREATE INDEX idx_requirement_library ON REQUIREMENT_LIBRARY(RL_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table gere les bibliotheques d''exigences. Une bibliotheque d''exigences peut contenir plusieurs repertoires 
				et/ou exigences, ces deux entites etant regroupees sous l''appellation generique d''element de bibliotheque d''exigences (requirement 
		...', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.10', '2.0.5', '3:70c11ac27e2a6bb65143efee427cd28e', 20);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.11::bsiri::(Checksum: 3:fd84d5da84499f830851aa8a825f8ff9)
-- Cette table gere les bibliotheques de campagnes. Une bibliotheque 
-- 		de campagnes peut contenir plusieurs repertoires et/ou campagnes, ces deux 
-- 		entites etant regroupees sous l'appellation generique d'element de bibliotheque 
-- 		de campagnes (campaign library nodes).
CREATE TABLE CAMPAIGN_LIBRARY (CL_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, PROJECT_ID BIGINT, CONSTRAINT PK_CAMPAIGN_LIBRARY PRIMARY KEY (CL_ID), CONSTRAINT fk_cl_project FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID));

CREATE INDEX idx_campaign_library ON CAMPAIGN_LIBRARY(CL_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table gere les bibliotheques de campagnes. Une bibliotheque 
		de campagnes peut contenir plusieurs repertoires et/ou campagnes, ces deux 
		entites etant regroupees sous l''appellation generique d''element de bibliotheque 
		de campagnes (campaign...', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.11', '2.0.5', '3:fd84d5da84499f830851aa8a825f8ff9', 21);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.12::ramoussou::(Checksum: 3:2e779973c9bd4020fafd9645e240fb4b)
ALTER TABLE PROJECT ADD CONSTRAINT fk_project_cl FOREIGN KEY (CL_ID) REFERENCES CAMPAIGN_LIBRARY (CL_ID);

ALTER TABLE PROJECT ADD CONSTRAINT fk_project_tcl FOREIGN KEY (TCL_ID) REFERENCES TEST_CASE_LIBRARY (TCL_ID);

ALTER TABLE PROJECT ADD CONSTRAINT fk_project_rl FOREIGN KEY (RL_ID) REFERENCES REQUIREMENT_LIBRARY (RL_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('ramoussou', '', NOW(), 'Add Foreign Key Constraint (x3)', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.12', '2.0.5', '3:2e779973c9bd4020fafd9645e240fb4b', 22);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.13::bsiri::(Checksum: 3:77ff261548687bed7e3050fc610081cc)
-- Cette table represente un element (generique) faisant partie d'une bibliotheque de cas de test. Cet element 
-- 		generique peut representer soit un repertoire, soit un cas de test. Pour cette raison, que l'utilisateur cree l'un ou 
-- 		l'autre cette table sera necessairement alimentee, et contiendra la cle primaire de l'element en question.
-- 		Toutefois le type reel de l'element cas de test ou repertoire) n'est pas renseigne, il est necessaire de rechercher 
-- 		si la cle est referencee dans la table TEST_CASE_FOLDER ou TEST_CASE pour determiner si cet element releve de l'un ou l'autre.
CREATE TABLE TEST_CASE_LIBRARY_NODE (TCLN_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, DELETED_ON TIMESTAMP DEFAULT null, DESCRIPTION LONGVARCHAR DEFAULT null, NAME VARCHAR(255) NOT NULL, CREATED_BY VARCHAR(50) NOT NULL, CREATED_ON TIMESTAMP NOT NULL, LAST_MODIFIED_BY VARCHAR(50) DEFAULT null, LAST_MODIFIED_ON TIMESTAMP DEFAULT null, PROJECT_ID BIGINT, CONSTRAINT PK_TEST_CASE_LIBRARY_NODE PRIMARY KEY (TCLN_ID), CONSTRAINT fk_tcln_project FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID));

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table represente un element (generique) faisant partie d''une bibliotheque de cas de test. Cet element 
		generique peut representer soit un repertoire, soit un cas de test. Pour cette raison, que l''utilisateur cree l''un ou 
		l''autre cette table ...', NOW(), 'Create Table', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.13', '2.0.5', '3:77ff261548687bed7e3050fc610081cc', 23);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.14::bsiri::(Checksum: 3:a9d2e473eafcd420919c707d59260567)
-- Cette table represente un element (generique) faisant partie d'une bibliotheque d'exigences. Cet element 
-- 				generique peut representer soit un repertoire, soit une exigence. Pour cette raison, que l'utilisateur cree l'un ou l'autre 
-- 				cette table sera necessairement alimentee, et contiendra la cle primaire de l'element en question. Toutefois le type reel 
-- 				de l'element (exigence ou repertoire) n'est pas renseigne, il est necessaire de rechercher si la cle est referencee dans 
-- 				la table REQUIREMENT_FOLDER ou REQUIREMENT pour determiner si cet element releve de l'un ou l'autre.
CREATE TABLE REQUIREMENT_LIBRARY_NODE (RLN_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, DELETED_ON TIMESTAMP DEFAULT null, DESCRIPTION LONGVARCHAR DEFAULT null, NAME VARCHAR(255) NOT NULL, CREATED_BY VARCHAR(50) NOT NULL, CREATED_ON TIMESTAMP NOT NULL, LAST_MODIFIED_BY VARCHAR(50) DEFAULT null, LAST_MODIFIED_ON TIMESTAMP DEFAULT null, PROJECT_ID BIGINT, CONSTRAINT PK_REQUIREMENT_LIBRARY_NODE PRIMARY KEY (RLN_ID), CONSTRAINT fk_rln_project FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID));

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table represente un element (generique) faisant partie d''une bibliotheque d''exigences. Cet element 
				generique peut representer soit un repertoire, soit une exigence. Pour cette raison, que l''utilisateur cree l''un ou l''autre 
				cette table s...', NOW(), 'Create Table', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.14', '2.0.5', '3:a9d2e473eafcd420919c707d59260567', 24);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.15::bsiri::(Checksum: 3:dabf7a16ee4eea69980a88a02299a585)
-- Cette table represente un element (generique) faisant partie 
-- 				d'une bibliotheque de campagne. Cet element generique peut representer soit 
-- 				un repertoire, soit une campagne. Pour cette raison, que l'utilisateur cree 
-- 				l'un ou l'autre cette table sera necessairement alimentee, et contiendra 
-- 				la cle primaire de l'element en question. Toutefois le type reel de l'element 
-- 				(campagne ou repertoire) n'est pas renseigne, il est necessaire de rechercher 
-- 				si la cle est referencee dans la table CAMPAIGN_FOLDER ou CAMPAIGN pour determiner 
-- 				si cet element releve de l'un ou l'autre.
CREATE TABLE CAMPAIGN_LIBRARY_NODE (CLN_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, DELETED_ON TIMESTAMP DEFAULT null, DESCRIPTION LONGVARCHAR DEFAULT null, NAME VARCHAR(255) NOT NULL, CREATED_BY VARCHAR(50) NOT NULL, CREATED_ON TIMESTAMP NOT NULL, LAST_MODIFIED_ON TIMESTAMP DEFAULT null, LAST_MODIFIED_BY VARCHAR(50) DEFAULT null, PROJECT_ID BIGINT DEFAULT NULL, CONSTRAINT PK_CAMPAIGN_LIBRARY_NODE PRIMARY KEY (CLN_ID), CONSTRAINT fk_cln_project FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID));

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table represente un element (generique) faisant partie 
				d''une bibliotheque de campagne. Cet element generique peut representer soit 
				un repertoire, soit une campagne. Pour cette raison, que l''utilisateur cree 
				l''un ou l''autre cette ta...', NOW(), 'Create Table', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.15', '2.0.5', '3:dabf7a16ee4eea69980a88a02299a585', 25);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.16::bsiri::(Checksum: 3:958c749a03fa027fdd348b7d4923fc52)
-- Cette table gere les cas de test proprement dits. Une entree dans cette table indique que l'element reference dans la table TEST_CASE_LIBRARY_NODE par la cle primaire (egalement cle etrangere) est de type cas de test.
CREATE TABLE TEST_CASE (TCLN_ID BIGINT NOT NULL, VERSION INT NOT NULL, EXECUTION_MODE VARCHAR(255) DEFAULT null, ATTACHMENT_LIST_ID BIGINT NOT NULL, CONSTRAINT PK_TEST_CASSE PRIMARY KEY (TCLN_ID), CONSTRAINT fk_test_case_attachment_list FOREIGN KEY (ATTACHMENT_LIST_ID) REFERENCES ATTACHMENT_LIST(ATTACHMENT_LIST_ID), CONSTRAINT fk_test_case_test_case_node FOREIGN KEY (TCLN_ID) REFERENCES TEST_CASE_LIBRARY_NODE(TCLN_ID));

CREATE INDEX idx_test_case ON TEST_CASE(TCLN_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table gere les cas de test proprement dits. Une entree dans cette table indique que l''element reference dans la table TEST_CASE_LIBRARY_NODE par la cle primaire (egalement cle etrangere) est de type cas de test.', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.16', '2.0.5', '3:958c749a03fa027fdd348b7d4923fc52', 26);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.17::bsiri::(Checksum: 3:7ab96cee4052f3f5d3d3202a15b0f734)
-- Cette table est rudimentaire. La cle primaire est simplement une cle etrangere vers la table TEST_CASE_LIBRARY_NODE (relation qualifiante). 
-- 		Une entree dans cette table indique que l'element indexe par cette cle est de type repertoire.
CREATE TABLE TEST_CASE_FOLDER (TCLN_ID BIGINT NOT NULL, CONSTRAINT PK_TEST_CASE_FOLDER PRIMARY KEY (TCLN_ID), CONSTRAINT fk_folder_test_case_node FOREIGN KEY (TCLN_ID) REFERENCES TEST_CASE_LIBRARY_NODE(TCLN_ID));

CREATE INDEX idx_tc_folder ON TEST_CASE_FOLDER(TCLN_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table est rudimentaire. La cle primaire est simplement une cle etrangere vers la table TEST_CASE_LIBRARY_NODE (relation qualifiante). 
		Une entree dans cette table indique que l''element indexe par cette cle est de type repertoire.', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.17', '2.0.5', '3:7ab96cee4052f3f5d3d3202a15b0f734', 27);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.18::bsiri::(Checksum: 3:974cd4efa946c3c586e4cf657e3da0f5)
-- Cette table associe les bibliotheques de cas de test a leur contenu (elements de bibliotheques de cas de test). 
-- 		Le contenu d'une bibliotheque de cas de test est arborescent et est represente suivant un patron composite 
-- 		(voire TEST_CASE_LIBRARY_NODE, TEST_CASE_FOLDER, TEST_CASE). Par defaut la presente table peut contenir uniquement 
-- 		les references vers les elements fils directs; on peut aussi mettre en relation une bibliotheque de cas de test avec 
-- 		n'importe quel element de son contenu (quelque soit sa profondeur hierarchique) pour des raisons d'optimisation.
CREATE TABLE TEST_CASE_LIBRARY_CONTENT (LIBRARY_ID BIGINT NOT NULL, CONTENT_ID BIGINT NOT NULL, CONSTRAINT fk_test_case_lib_content_content FOREIGN KEY (CONTENT_ID) REFERENCES TEST_CASE_LIBRARY_NODE(TCLN_ID), CONSTRAINT fk_test_case_lib_content_lib FOREIGN KEY (LIBRARY_ID) REFERENCES TEST_CASE_LIBRARY(TCL_ID), UNIQUE (CONTENT_ID));

CREATE INDEX idx_test_case_lib_content_content ON TEST_CASE_LIBRARY_CONTENT(CONTENT_ID);

CREATE INDEX idx_test_case_lib_content_lib ON TEST_CASE_LIBRARY_CONTENT(LIBRARY_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table associe les bibliotheques de cas de test a leur contenu (elements de bibliotheques de cas de test). 
		Le contenu d''une bibliotheque de cas de test est arborescent et est represente suivant un patron composite 
		(voire TEST_CASE_LIBRARY_NO...', NOW(), 'Create Table, Create Index (x2)', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.18', '2.0.5', '3:974cd4efa946c3c586e4cf657e3da0f5', 28);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.19::bsiri::(Checksum: 3:afae4a16d26c6b777160d1c69eeb7980)
-- Cette table gere la hierarchie entre elements d'une bibliotheque de cas de test, associant un element fils a 
-- 		un repertoire parent (si non NULL) ou eventuellement aucun (NULL, dans le cas ou l'element est a la racine de la bibliotheque 
-- 		de cas de test).
CREATE TABLE TCLN_RELATIONSHIP (ANCESTOR_ID BIGINT NOT NULL, DESCENDANT_ID BIGINT NOT NULL, CONSTRAINT fk_tcln_relationship_descendant FOREIGN KEY (DESCENDANT_ID) REFERENCES TEST_CASE_LIBRARY_NODE(TCLN_ID), CONSTRAINT fk_tcln_relationship_ancestor FOREIGN KEY (ANCESTOR_ID) REFERENCES TEST_CASE_FOLDER(TCLN_ID), UNIQUE (DESCENDANT_ID));

CREATE INDEX idx_tcln_relationship_descendant ON TCLN_RELATIONSHIP(DESCENDANT_ID);

CREATE INDEX idx_tcln_relationship_ancestor ON TCLN_RELATIONSHIP(ANCESTOR_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table gere la hierarchie entre elements d''une bibliotheque de cas de test, associant un element fils a 
		un repertoire parent (si non NULL) ou eventuellement aucun (NULL, dans le cas ou l''element est a la racine de la bibliotheque 
		de cas de t...', NOW(), 'Create Table, Create Index (x2)', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.19', '2.0.5', '3:afae4a16d26c6b777160d1c69eeb7980', 29);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.20::bsiri::(Checksum: 3:a338d63bb4e8bdc84a9be5748180a008)
-- Cette table gere les campagnes proprement dites. Une entree 
-- 				dans cette table indique que l'element reference dans la table CAMPAIGN_LIBRARY_NODE 
-- 				par la cle primaire (egalement cle etrangere) est de type campagne.
CREATE TABLE CAMPAIGN (CLN_ID BIGINT NOT NULL, ACTUAL_END_AUTO BOOLEAN NOT NULL, ACTUAL_END_DATE TIMESTAMP DEFAULT null, ACTUAL_START_AUTO BOOLEAN NOT NULL, ACTUAL_START_DATE TIMESTAMP DEFAULT null, SCHEDULED_END_DATE TIMESTAMP DEFAULT null, SCHEDULED_START_DATE TIMESTAMP DEFAULT null, ATTACHMENT_LIST_ID BIGINT, CONSTRAINT PK_CAMPAIGN PRIMARY KEY (CLN_ID), CONSTRAINT fk_campaign_attachment_list FOREIGN KEY (ATTACHMENT_LIST_ID) REFERENCES ATTACHMENT_LIST(ATTACHMENT_LIST_ID), CONSTRAINT FK_CAMPAIGN_CL_NODE FOREIGN KEY (CLN_ID) REFERENCES CAMPAIGN_LIBRARY_NODE(CLN_ID));

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table gere les campagnes proprement dites. Une entree 
				dans cette table indique que l''element reference dans la table CAMPAIGN_LIBRARY_NODE 
				par la cle primaire (egalement cle etrangere) est de type campagne.', NOW(), 'Create Table', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.20', '2.0.5', '3:a338d63bb4e8bdc84a9be5748180a008', 30);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.21::bsiri::(Checksum: 3:097d056da8cab56d6c7510dca188b264)
-- Cette table est rudimentaire. La cle primaire est simplement 
-- 				une cle etrangere vers la table CAMPAIGN_LIBRARY_NODE (relation qualifiante). 
-- 				Une entree dans cette table indique que l'element indexe par cette cle est 
-- 				de type repertoire.
CREATE TABLE CAMPAIGN_FOLDER (CLN_ID BIGINT NOT NULL, CONSTRAINT PK_CAMPAIGN_FOLDER PRIMARY KEY (CLN_ID), CONSTRAINT FK_CAMPAIGN_FOLDER_CL_NODE FOREIGN KEY (CLN_ID) REFERENCES CAMPAIGN_LIBRARY_NODE(CLN_ID));

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table est rudimentaire. La cle primaire est simplement 
				une cle etrangere vers la table CAMPAIGN_LIBRARY_NODE (relation qualifiante). 
				Une entree dans cette table indique que l''element indexe par cette cle est 
				de type repertoire.', NOW(), 'Create Table', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.21', '2.0.5', '3:097d056da8cab56d6c7510dca188b264', 31);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.22::bsiri::(Checksum: 3:a45d3cfc2a298842fef802a55c8f7779)
-- Cette table gere les bibliotheques de campagnes. Une bibliotheque 
-- 				de campagnes peut contenir plusieurs repertoires et/ou campagnes, ces deux 
-- 				entites etant regroupees sous l'appellation generique d'element de bibliotheque 
-- 				de campagnes (campaign library nodes).
CREATE TABLE CAMPAIGN_LIBRARY_CONTENT (LIBRARY_ID BIGINT NOT NULL, CONTENT_ID BIGINT NOT NULL, CONSTRAINT fk_cl_content_lib FOREIGN KEY (LIBRARY_ID) REFERENCES CAMPAIGN_LIBRARY(CL_ID), CONSTRAINT fk_cl_content_content FOREIGN KEY (CONTENT_ID) REFERENCES CAMPAIGN_LIBRARY_NODE(CLN_ID), UNIQUE (CONTENT_ID));

CREATE UNIQUE INDEX dx_cl_content_cl_node ON CAMPAIGN_LIBRARY_CONTENT(CONTENT_ID);

CREATE INDEX dx_cl_content_campaign_lib ON CAMPAIGN_LIBRARY_CONTENT(LIBRARY_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table gere les bibliotheques de campagnes. Une bibliotheque 
				de campagnes peut contenir plusieurs repertoires et/ou campagnes, ces deux 
				entites etant regroupees sous l''appellation generique d''element de bibliotheque 
				de campagnes (ca...', NOW(), 'Create Table, Create Index (x2)', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.22', '2.0.5', '3:a45d3cfc2a298842fef802a55c8f7779', 32);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.23::bsiri::(Checksum: 3:d2df248f7905d7cd3031d82abae63bf4)
-- Cette table gere la hierarchie entre elements d'une bibliotheque 
-- 				de campagne, associant un element fils a un repertoire parent (si non NULL) 
-- 				ou eventuellement aucun (NULL, dans le cas ou l'element est a la racine de 
-- 				la bibliotheque de campagne).
CREATE TABLE CLN_RELATIONSHIP (ANCESTOR_ID BIGINT NOT NULL, DESCENDANT_ID BIGINT NOT NULL, CONSTRAINT fk_cln_relationship_ancestor FOREIGN KEY (ANCESTOR_ID) REFERENCES CAMPAIGN_FOLDER(CLN_ID), CONSTRAINT idx_cln_relationship_descendant FOREIGN KEY (DESCENDANT_ID) REFERENCES CAMPAIGN_LIBRARY_NODE(CLN_ID), UNIQUE (DESCENDANT_ID));

CREATE INDEX dx_cln_relationship_descendant ON CLN_RELATIONSHIP(DESCENDANT_ID);

CREATE INDEX dx_cln_relationship_ancestor ON CLN_RELATIONSHIP(ANCESTOR_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table gere la hierarchie entre elements d''une bibliotheque 
				de campagne, associant un element fils a un repertoire parent (si non NULL) 
				ou eventuellement aucun (NULL, dans le cas ou l''element est a la racine de 
				la bibliotheque de ca...', NOW(), 'Create Table, Create Index (x2)', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.23', '2.0.5', '3:d2df248f7905d7cd3031d82abae63bf4', 33);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.24::bsiri::(Checksum: 3:73bf704391132aab5dba024c0ac13c38)
CREATE TABLE ITERATION (ITERATION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, DELETED_ON TIMESTAMP DEFAULT null, DESCRIPTION LONGVARCHAR DEFAULT null, NAME VARCHAR(255) NOT NULL, CREATED_BY VARCHAR(50) NOT NULL, CREATED_ON TIMESTAMP NOT NULL, LAST_MODIFIED_BY VARCHAR(50) DEFAULT null, LAST_MODIFIED_ON TIMESTAMP DEFAULT null, ACTUAL_END_AUTO BOOLEAN NOT NULL, ACTUAL_END_DATE TIMESTAMP DEFAULT null, ACTUAL_START_AUTO BOOLEAN NOT NULL, ACTUAL_START_DATE TIMESTAMP DEFAULT null, SCHEDULED_END_DATE TIMESTAMP DEFAULT null, SCHEDULED_START_DATE TIMESTAMP DEFAULT null, ATTACHMENT_LIST_ID BIGINT, CONSTRAINT PK_ITERATION PRIMARY KEY (ITERATION_ID), CONSTRAINT fk_iteration__attachment_list FOREIGN KEY (ATTACHMENT_LIST_ID) REFERENCES ATTACHMENT_LIST(ATTACHMENT_LIST_ID));

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', '', NOW(), 'Create Table', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.24', '2.0.5', '3:73bf704391132aab5dba024c0ac13c38', 34);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.25::bsiri::(Checksum: 3:51e8cc1f164086246ecead34823b1448)
CREATE TABLE CAMPAIGN_ITERATION (CAMPAIGN_ID BIGINT NOT NULL, ITERATION_ID BIGINT NOT NULL, ITERATION_ORDER INT NOT NULL, CONSTRAINT fk_camp_iter_iteration FOREIGN KEY (ITERATION_ID) REFERENCES ITERATION(ITERATION_ID), CONSTRAINT fk_camp_iter_campaign FOREIGN KEY (CAMPAIGN_ID) REFERENCES CAMPAIGN(CLN_ID));

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', '', NOW(), 'Create Table', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.25', '2.0.5', '3:51e8cc1f164086246ecead34823b1448', 35);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.26::bsiri::(Checksum: 3:5a513e8d87c090f9bc4b47b47bf05c8a)
-- Cette table gere les pas de test d'un cas de test.
CREATE TABLE TEST_STEP (TEST_STEP_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, EXPECTED_RESULT LONGVARCHAR DEFAULT null, ACTION LONGVARCHAR NOT NULL, ATTACHMENT_LIST_ID BIGINT, CONSTRAINT PK_TEST_STEP PRIMARY KEY (TEST_STEP_ID), CONSTRAINT fk_test_step__attachment_list FOREIGN KEY (ATTACHMENT_LIST_ID) REFERENCES ATTACHMENT_LIST(ATTACHMENT_LIST_ID));

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table gere les pas de test d''un cas de test.', NOW(), 'Create Table', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.26', '2.0.5', '3:5a513e8d87c090f9bc4b47b47bf05c8a', 36);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.27::bsiri::(Checksum: 3:f7aa9c081ea1f80aabaa9d9e35cdf43a)
-- Cette table associe un cas de test a ses pas de test. Meme si virtuellement la relation entre un cas de 
-- 		test et sa liste de pas de test est 1..*, cette table d'association existe pour ajouter un attribut d'ordre (la 
-- 		liste des pas de test est ordonnee). La cle primaire est ici composite, et ne doit pas etre autogeneree.
CREATE TABLE TEST_CASE_STEPS (TEST_CASE_ID BIGINT NOT NULL, STEP_ID BIGINT NOT NULL, STEP_ORDER INT NOT NULL, CONSTRAINT fk_tc_steps_step FOREIGN KEY (STEP_ID) REFERENCES TEST_STEP(TEST_STEP_ID), CONSTRAINT fk_tc_steps_tc FOREIGN KEY (TEST_CASE_ID) REFERENCES TEST_CASE(TCLN_ID));

CREATE INDEX idx_tc_steps_step ON TEST_CASE_STEPS(STEP_ID);

CREATE INDEX idx_tc_steps_tc ON TEST_CASE_STEPS(TEST_CASE_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table associe un cas de test a ses pas de test. Meme si virtuellement la relation entre un cas de 
		test et sa liste de pas de test est 1..*, cette table d''association existe pour ajouter un attribut d''ordre (la 
		liste des pas de test est ordo...', NOW(), 'Create Table, Create Index (x2)', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.27', '2.0.5', '3:f7aa9c081ea1f80aabaa9d9e35cdf43a', 37);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.28::xpr::(Checksum: 3:f0fe8221736982edf61f00098266d93f)
CREATE TABLE PROJECT_FILTER (PROJECT_FILTER_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, ACTIVATED BOOLEAN DEFAULT FALSE NOT NULL, USER_LOGIN VARCHAR(255) NOT NULL, CONSTRAINT PK_PROJECT_FILTER PRIMARY KEY (PROJECT_FILTER_ID));

CREATE INDEX DX_UN_PROJECT_FILTER_USER ON PROJECT_FILTER(USER_LOGIN);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('xpr', '', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.28', '2.0.5', '3:f0fe8221736982edf61f00098266d93f', 38);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.29::xpr::(Checksum: 3:84be3a27181bbaf2e53d715219078843)
CREATE TABLE PROJECT_FILTER_ENTRY (PROJECT_ID BIGINT NOT NULL, FILTER_ID BIGINT NOT NULL, CONSTRAINT FK_PROJ_FILTER_ENTRY_PROJ FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID), CONSTRAINT FK_PROJ_FILTER_ENTRY_PROJ_FILTER FOREIGN KEY (FILTER_ID) REFERENCES PROJECT_FILTER(PROJECT_FILTER_ID));

ALTER TABLE PROJECT_FILTER_ENTRY ADD CONSTRAINT PK_PROJ_FILTER_ENTRY PRIMARY KEY (PROJECT_ID, FILTER_ID);

CREATE INDEX dx_pfp_project ON PROJECT_FILTER_ENTRY(PROJECT_ID);

CREATE INDEX dx_pfp_filter ON PROJECT_FILTER_ENTRY(FILTER_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('xpr', '', NOW(), 'Create Table, Add Primary Key, Create Index (x2)', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.29', '2.0.5', '3:84be3a27181bbaf2e53d715219078843', 39);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.30::bsiri::(Checksum: 3:4e4246703f7bfc305b0e14b9ed587820)
-- Cette table gere les exigences proprement dites. Une entree dans cette table indique que l'element reference 
-- 				dans la table REQUIREMENT_LIBRARY_NODE par la cle primaire (egalement cle etrangere) est de type exigence.
CREATE TABLE REQUIREMENT (RLN_ID BIGINT NOT NULL, REFERENCE VARCHAR(20), CRITICALITY VARCHAR(255) DEFAULT 'UNDEFINED' NOT NULL, ATTACHMENT_LIST_ID BIGINT NOT NULL, CONSTRAINT PK_REQUIREMENT PRIMARY KEY (RLN_ID), CONSTRAINT fk_requirement_attachment_list FOREIGN KEY (ATTACHMENT_LIST_ID) REFERENCES ATTACHMENT_LIST(ATTACHMENT_LIST_ID), CONSTRAINT fk_requirement_requirement_node FOREIGN KEY (RLN_ID) REFERENCES REQUIREMENT_LIBRARY_NODE(RLN_ID));

CREATE INDEX idx_requirement ON REQUIREMENT(RLN_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table gere les exigences proprement dites. Une entree dans cette table indique que l''element reference 
				dans la table REQUIREMENT_LIBRARY_NODE par la cle primaire (egalement cle etrangere) est de type exigence.', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.30', '2.0.5', '3:4e4246703f7bfc305b0e14b9ed587820', 40);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.31::bsiri::(Checksum: 3:df70c5c8de2e94240a24f3eda7a972dc)
-- Cette table est rudimentaire. La cle primaire est simplement une cle etrangere vers la table REQUIREMENT_LIBRARY_NODE 
-- 				(relation qualifiante). Une entree dans cette table indique que l'element indexe par cette cle est de type repertoire.
CREATE TABLE REQUIREMENT_FOLDER (RLN_ID BIGINT NOT NULL, CONSTRAINT PK_REQUIREMENT_FOLDER PRIMARY KEY (RLN_ID), CONSTRAINT fk_folder_requirement_node FOREIGN KEY (RLN_ID) REFERENCES REQUIREMENT_LIBRARY_NODE(RLN_ID));

CREATE INDEX idx_req_folder ON REQUIREMENT_FOLDER(RLN_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table est rudimentaire. La cle primaire est simplement une cle etrangere vers la table REQUIREMENT_LIBRARY_NODE 
				(relation qualifiante). Une entree dans cette table indique que l''element indexe par cette cle est de type repertoire.', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.31', '2.0.5', '3:df70c5c8de2e94240a24f3eda7a972dc', 41);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.32::bsiri::(Checksum: 3:f3c140be4ee750aaf78e1b6985ecfbac)
-- Cette table associe les bibliotheques d'exigences a leur contenu (elements de bibliotheques d'exigence). 
-- 		Le contenu d'une bibliotheque d'exigence est arborescent et est represente suivant un patron composite (voire REQUIREMENT_LIBRARY_NODE, 
-- 		REQUIREMENT_FOLDER, REQUIREMENT). Par defaut la presente table peut contenir uniquement les references vers les elements 
-- 		fils directs; on peut aussi mettre en relation une bibliotheque d'exigence avec n'importe quel element de son contenu (quelque 
-- 		soit sa profondeur hierarchique) pour des raisons d'optimisation.
CREATE TABLE REQUIREMENT_LIBRARY_CONTENT (LIBRARY_ID BIGINT NOT NULL, CONTENT_ID BIGINT NOT NULL, CONSTRAINT fk_requirement_lib_content_content FOREIGN KEY (CONTENT_ID) REFERENCES REQUIREMENT_LIBRARY_NODE(RLN_ID), CONSTRAINT fk_requirement_lib_content_lib FOREIGN KEY (LIBRARY_ID) REFERENCES REQUIREMENT_LIBRARY(RL_ID), UNIQUE (CONTENT_ID));

CREATE INDEX idx_requirement_lib_content_content ON REQUIREMENT_LIBRARY_CONTENT(CONTENT_ID);

CREATE INDEX idx_requirement_lib_content_lib ON REQUIREMENT_LIBRARY_CONTENT(LIBRARY_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table associe les bibliotheques d''exigences a leur contenu (elements de bibliotheques d''exigence). 
		Le contenu d''une bibliotheque d''exigence est arborescent et est represente suivant un patron composite (voire REQUIREMENT_LIBRARY_NODE, 
		REQUI...', NOW(), 'Create Table, Create Index (x2)', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.32', '2.0.5', '3:f3c140be4ee750aaf78e1b6985ecfbac', 42);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.33::bsiri::(Checksum: 3:2871df094de3dea7956c501df28c6a3c)
-- Cette table gere la hierarchie entre elements d'une bibliotheque d'exigences, associant un element fils 
-- 				a un repertoire parent.
CREATE TABLE RLN_RELATIONSHIP (ANCESTOR_ID BIGINT NOT NULL, DESCENDANT_ID BIGINT NOT NULL, CONSTRAINT fk_rln_relationship_ancestor FOREIGN KEY (ANCESTOR_ID) REFERENCES REQUIREMENT_FOLDER(RLN_ID), CONSTRAINT fk_rln_relationship_descendant FOREIGN KEY (DESCENDANT_ID) REFERENCES REQUIREMENT_LIBRARY_NODE(RLN_ID), UNIQUE (DESCENDANT_ID));

CREATE INDEX idx_rln_relationship_descendant ON RLN_RELATIONSHIP(DESCENDANT_ID);

CREATE INDEX idx_rln_relationship_ancestor ON RLN_RELATIONSHIP(ANCESTOR_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table gere la hierarchie entre elements d''une bibliotheque d''exigences, associant un element fils 
				a un repertoire parent.', NOW(), 'Create Table, Create Index (x2)', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.33', '2.0.5', '3:2871df094de3dea7956c501df28c6a3c', 43);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.34::bsiri::(Checksum: 3:677016450819c882153db2d9093348b1)
-- Cette table associe un cas de test avec une liste d'execution. Elle conserve également
-- 		en mémoire le status d'execution, qui devra sera mis à jour au fur et à mesure qu'une execution 
-- 		est ajoutée ou exécutée.
CREATE TABLE ITEM_TEST_PLAN (ITEM_TEST_PLAN_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, EXECUTION_STATUS VARCHAR(255) DEFAULT null, LAST_EXECUTED_BY VARCHAR(255) DEFAULT null, LAST_EXECUTED_ON TIMESTAMP DEFAULT null, TCLN_ID BIGINT, LABEL VARCHAR(255), CREATED_BY VARCHAR(50) NOT NULL, CREATED_ON TIMESTAMP NOT NULL, LAST_MODIFIED_BY VARCHAR(50) DEFAULT null, LAST_MODIFIED_ON TIMESTAMP DEFAULT null, CONSTRAINT PK_ITEM_TEST_PLAN PRIMARY KEY (ITEM_TEST_PLAN_ID), CONSTRAINT fk_itertestplan_test_case FOREIGN KEY (TCLN_ID) REFERENCES TEST_CASE(TCLN_ID));

CREATE INDEX idx_itertestplan ON ITEM_TEST_PLAN(ITEM_TEST_PLAN_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table associe un cas de test avec une liste d''execution. Elle conserve également
		en mémoire le status d''execution, qui devra sera mis à jour au fur et à mesure qu''une execution 
		est ajoutée ou exécutée.', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.34', '2.0.5', '3:677016450819c882153db2d9093348b1', 44);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.35::bsiri::(Checksum: 3:bbb6238456ee0b3789507be210559f4a)
-- Cette table associe une iteration a ses test plans. Même si virtuellement la relation entre une iteration
-- 		 et sa liste de test plans est 1..*, cette table d'association existe pour ajouter un attribut d'ordre (la 
-- 		liste des test plans est ordonnée). La clé primaire est ici composite, et ne doit pas être autogénérée.
CREATE TABLE ITEM_TEST_PLAN_LIST (ITERATION_ID BIGINT NOT NULL, ITEM_TEST_PLAN_ID BIGINT NOT NULL, ITEM_TEST_PLAN_ORDER INT NOT NULL, CONSTRAINT fk_item_test_plan_iteration FOREIGN KEY (ITERATION_ID) REFERENCES ITERATION(ITERATION_ID), CONSTRAINT fk_ITEM_TESTplan_testplan FOREIGN KEY (ITEM_TEST_PLAN_ID) REFERENCES ITEM_TEST_PLAN(ITEM_TEST_PLAN_ID));

CREATE INDEX idx_ITEM_TESTplan_iteration ON ITEM_TEST_PLAN_LIST(ITERATION_ID);

CREATE INDEX idx_ITEM_TESTplan_testplan ON ITEM_TEST_PLAN_LIST(ITEM_TEST_PLAN_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table associe une iteration a ses test plans. Même si virtuellement la relation entre une iteration
		 et sa liste de test plans est 1..*, cette table d''association existe pour ajouter un attribut d''ordre (la 
		liste des test plans est ordonnée)...', NOW(), 'Create Table, Create Index (x2)', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.35', '2.0.5', '3:bbb6238456ee0b3789507be210559f4a', 45);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.36::bsiri::(Checksum: 3:6db9b5c08ba6fc50bfb43f5109fa5a43)
-- Table des executions. Une execution correspond à un cas de test, et ses pas d'execution (voir EXECUTION_STEP) correspondent
-- 		à des pas de test. Pour assurer un contrôle sur les modifications de l'entité source une référence est gardée vers le 
-- 		cas de test source (de même que EXECUTION_STEP garde une référence vers le TEST_STEP correspondant, même si les données sont 
-- 		dans les faits dupliqués).
CREATE TABLE EXECUTION (EXECUTION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, TCLN_ID BIGINT, CREATED_BY VARCHAR(50) NOT NULL, CREATED_ON TIMESTAMP NOT NULL, LAST_MODIFIED_BY VARCHAR(50) DEFAULT null, LAST_MODIFIED_ON TIMESTAMP DEFAULT null, DESCRIPTION LONGVARCHAR DEFAULT null, NAME VARCHAR(255) NOT NULL, EXECUTION_MODE VARCHAR(255) DEFAULT null, EXECUTION_STATUS VARCHAR(255) DEFAULT null, LAST_EXECUTED_BY VARCHAR(255) DEFAULT null, LAST_EXECUTED_ON TIMESTAMP DEFAULT null, ATTACHMENT_LIST_ID BIGINT, ISSUE_LIST_ID BIGINT NOT NULL, CONSTRAINT PK_EXECUTION PRIMARY KEY (EXECUTION_ID), CONSTRAINT fk_execution_attachment_list FOREIGN KEY (ATTACHMENT_LIST_ID) REFERENCES ATTACHMENT_LIST(ATTACHMENT_LIST_ID), CONSTRAINT fk_execution_issue_list FOREIGN KEY (ISSUE_LIST_ID) REFERENCES ISSUE_LIST(ISSUE_LIST_ID), CONSTRAINT fk_execution_test_case FOREIGN KEY (TCLN_ID) REFERENCES TEST_CASE(TCLN_ID));

CREATE INDEX idx_execution ON EXECUTION(EXECUTION_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Table des executions. Une execution correspond à un cas de test, et ses pas d''execution (voir EXECUTION_STEP) correspondent
		à des pas de test. Pour assurer un contrôle sur les modifications de l''entité source une référence est gardée vers le 
		cas d...', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.36', '2.0.5', '3:6db9b5c08ba6fc50bfb43f5109fa5a43', 46);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.37::bsiri::(Checksum: 3:2cc260f36456b3930ceede7332059452)
-- Associe les executions aux test plans
CREATE TABLE ITEM_TEST_PLAN_EXECUTION (ITEM_TEST_PLAN_ID BIGINT NOT NULL, EXECUTION_ID BIGINT NOT NULL, EXECUTION_ORDER INT NOT NULL, CONSTRAINT fk_testplan_exec_exec FOREIGN KEY (EXECUTION_ID) REFERENCES EXECUTION(EXECUTION_ID), CONSTRAINT fk_testplan_exec_testplan FOREIGN KEY (ITEM_TEST_PLAN_ID) REFERENCES ITEM_TEST_PLAN(ITEM_TEST_PLAN_ID));

CREATE INDEX idx_testplan_exec_testplan ON ITEM_TEST_PLAN_EXECUTION(ITEM_TEST_PLAN_ID);

CREATE INDEX idx_testplan_exec_exec ON ITEM_TEST_PLAN_EXECUTION(EXECUTION_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Associe les executions aux test plans', NOW(), 'Create Table, Create Index (x2)', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.37', '2.0.5', '3:2cc260f36456b3930ceede7332059452', 47);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.38::bsiri::(Checksum: 3:0b7eeee1a4e20b8418ec30b1d220cbf5)
-- Cette table gère les pas d'execution d'une execution. Voir la table EXECUTION pour plus de détails.
CREATE TABLE EXECUTION_STEP (EXECUTION_STEP_ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, EXPECTED_RESULT LONGVARCHAR DEFAULT null, ACTION LONGVARCHAR NOT NULL, EXECUTION_STATUS VARCHAR(255) DEFAULT null, LAST_EXECUTED_BY VARCHAR(255) DEFAULT null, LAST_EXECUTED_ON TIMESTAMP DEFAULT null, COMMENT LONGVARCHAR, TEST_STEP_ID BIGINT, CREATED_BY VARCHAR(50) NOT NULL, CREATED_ON TIMESTAMP NOT NULL, LAST_MODIFIED_BY VARCHAR(50) DEFAULT null, LAST_MODIFIED_ON TIMESTAMP DEFAULT null, ATTACHMENT_LIST_ID BIGINT, ISSUE_LIST_ID BIGINT NOT NULL, CONSTRAINT PK_EXECUTION_STEP PRIMARY KEY (EXECUTION_STEP_ID), CONSTRAINT fk_execution_step_issue_list FOREIGN KEY (ISSUE_LIST_ID) REFERENCES ISSUE_LIST(ISSUE_LIST_ID), CONSTRAINT fk_execution_step__attachment_list FOREIGN KEY (ATTACHMENT_LIST_ID) REFERENCES ATTACHMENT_LIST(ATTACHMENT_LIST_ID), CONSTRAINT fk_executionstep_teststep FOREIGN KEY (TEST_STEP_ID) REFERENCES TEST_STEP(TEST_STEP_ID));

CREATE INDEX idx_executionstep ON EXECUTION_STEP(EXECUTION_STEP_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table gère les pas d''execution d''une execution. Voir la table EXECUTION pour plus de détails.', NOW(), 'Create Table, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.38', '2.0.5', '3:0b7eeee1a4e20b8418ec30b1d220cbf5', 48);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.39::bsiri::(Checksum: 3:973dad84ab8afd2ed0428f2fcad18c33)
-- Cette table associe une executions à ses pas d'execution. Même si virtuellement la relation entre une execution
-- 		 et sa liste de pas d'execution est 1..*, cette table d'association existe pour ajouter un attribut d'ordre (la 
-- 		liste des pas executions est ordonnée). La clé primaire est ici composite, et ne doit pas être autogénérée.
CREATE TABLE EXECUTION_EXECUTION_STEPS (EXECUTION_ID BIGINT NOT NULL, EXECUTION_STEP_ID BIGINT NOT NULL, EXECUTION_STEP_ORDER INT NOT NULL, CONSTRAINT fk_exec_exec_step_exec_step FOREIGN KEY (EXECUTION_STEP_ID) REFERENCES EXECUTION_STEP(EXECUTION_STEP_ID), CONSTRAINT fk_exec_exec_step_exec FOREIGN KEY (EXECUTION_ID) REFERENCES EXECUTION(EXECUTION_ID));

CREATE INDEX idx_exec_exec_step_exec ON EXECUTION_EXECUTION_STEPS(EXECUTION_ID);

CREATE INDEX idx_exec_exec_step_exec_step ON EXECUTION_EXECUTION_STEPS(EXECUTION_STEP_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table associe une executions à ses pas d''execution. Même si virtuellement la relation entre une execution
		 et sa liste de pas d''execution est 1..*, cette table d''association existe pour ajouter un attribut d''ordre (la 
		liste des pas execution...', NOW(), 'Create Table, Create Index (x2)', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.39', '2.0.5', '3:973dad84ab8afd2ed0428f2fcad18c33', 49);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.40::bsiri::(Checksum: 3:022678424f32aff0ea457d87cfc81c39)
-- Cette table gere les associations entre cas de test et exigences. 
-- 				La cle primaire est composite et ne doit pas etre autogeneree.
CREATE TABLE TEST_CASE_REQUIREMENT_LINK (TEST_CASE_ID BIGINT NOT NULL, REQUIREMENT_ID BIGINT NOT NULL, CONSTRAINT fk_tc_req_req FOREIGN KEY (REQUIREMENT_ID) REFERENCES REQUIREMENT(RLN_ID), CONSTRAINT fk_tc_req_tc FOREIGN KEY (TEST_CASE_ID) REFERENCES TEST_CASE(TCLN_ID));

ALTER TABLE TEST_CASE_REQUIREMENT_LINK ADD CONSTRAINT pk_tc_req_link PRIMARY KEY (TEST_CASE_ID, REQUIREMENT_ID);

CREATE INDEX idx_tc_req_tc ON TEST_CASE_REQUIREMENT_LINK(TEST_CASE_ID);

CREATE INDEX idx_tc_req_req ON TEST_CASE_REQUIREMENT_LINK(REQUIREMENT_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', 'Cette table gere les associations entre cas de test et exigences. 
				La cle primaire est composite et ne doit pas etre autogeneree.', NOW(), 'Create Table, Add Primary Key, Create Index (x2)', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.40', '2.0.5', '3:022678424f32aff0ea457d87cfc81c39', 50);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.41::adurand::(Checksum: 3:05303033f44dedf713634bc5d2a8f876)
-- Cette table gere les associations entre les campagnes et les cas de test (= les plans de test des campagnes).La cle primaire est composite et ne doit pas etre autogeneree.
CREATE TABLE CAMPAIGN_TEST_PLAN (CAMPAIGN_ID BIGINT NOT NULL, TEST_CASE_ID BIGINT NOT NULL, CONSTRAINT fk_camp_tp_camp FOREIGN KEY (CAMPAIGN_ID) REFERENCES CAMPAIGN(CLN_ID), CONSTRAINT fk_camp_tp_tc FOREIGN KEY (TEST_CASE_ID) REFERENCES TEST_CASE(TCLN_ID));

ALTER TABLE CAMPAIGN_TEST_PLAN ADD CONSTRAINT pk_camp_tp PRIMARY KEY (CAMPAIGN_ID, TEST_CASE_ID);

CREATE INDEX idx_camp_tp_camp ON CAMPAIGN_TEST_PLAN(CAMPAIGN_ID);

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('adurand', 'Cette table gere les associations entre les campagnes et les cas de test (= les plans de test des campagnes).La cle primaire est composite et ne doit pas etre autogeneree.', NOW(), 'Create Table, Add Primary Key, Create Index', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.41', '2.0.5', '3:05303033f44dedf713634bc5d2a8f876', 51);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.42::bsiri::(Checksum: 3:efcf1c28e93336d052ae489901878a3a)
alter table ATTACHMENT_CONTENT alter column STREAM_CONTENT BLOB;

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('bsiri', '', NOW(), 'Custom SQL', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.42', '2.0.5', '3:efcf1c28e93336d052ae489901878a3a', 52);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.43::xpr::(Checksum: 3:ae6e2167fb4b8136983297802a1c7d60)
-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.44::gfouquet::(Checksum: 3:67ee96d82ee3e4cc07bf2c0e252cee36)
INSERT INTO CORE_GROUP_AUTHORITY (AUTHORITY, GROUP_ID) VALUES ('ROLE_TM_USER', (select ID from CORE_GROUP where QUALIFIED_NAME='squashtest.authz.group.core.Admin'));

INSERT INTO CORE_GROUP (QUALIFIED_NAME) VALUES ('squashtest.tm.group.User');

INSERT INTO CORE_GROUP_AUTHORITY (AUTHORITY, GROUP_ID) VALUES ('ROLE_TM_USER', (select max(ID) from CORE_GROUP));

INSERT INTO CORE_GROUP (QUALIFIED_NAME) VALUES ('squashtest.authz.group.tm.ProjectManager');

INSERT INTO CORE_GROUP_AUTHORITY (AUTHORITY, GROUP_ID) VALUES ('ROLE_TM_PROJECT_MANAGER', (select max(ID) from CORE_GROUP));

INSERT INTO ACL_CLASS (CLASSNAME) VALUES ('org.squashtest.csp.tm.domain.project.Project');

INSERT INTO ACL_GROUP (QUALIFIED_NAME) VALUES ('squashtest.acl.group.tm.ProjectManager');

INSERT INTO ACL_GROUP_PERMISSION (ACL_GROUP_ID, CLASS_ID, PERMISSION_MASK) VALUES ((select ID from ACL_GROUP where QUALIFIED_NAME = 'squashtest.acl.group.tm.ProjectManager'), (select ID from ACL_CLASS where CLASSNAME = 'org.squashtest.csp.tm.domain.project.Project'), '15');

INSERT INTO ACL_GROUP_PERMISSION (ACL_GROUP_ID, CLASS_ID, PERMISSION_MASK) VALUES ((select ID from ACL_GROUP where QUALIFIED_NAME = 'squashtest.acl.group.tm.ProjectManager'), (select ID from ACL_CLASS where CLASSNAME = 'org.squashtest.csp.tm.domain.project.Project'), '1');

INSERT INTO ACL_GROUP_PERMISSION (ACL_GROUP_ID, CLASS_ID, PERMISSION_MASK) VALUES ((select ID from ACL_GROUP where QUALIFIED_NAME = 'squashtest.acl.group.tm.ProjectManager'), (select ID from ACL_CLASS where CLASSNAME = 'org.squashtest.csp.tm.domain.project.Project'), '2');

INSERT INTO ACL_GROUP_PERMISSION (ACL_GROUP_ID, CLASS_ID, PERMISSION_MASK) VALUES ((select ID from ACL_GROUP where QUALIFIED_NAME = 'squashtest.acl.group.tm.ProjectManager'), (select ID from ACL_CLASS where CLASSNAME = 'org.squashtest.csp.tm.domain.project.Project'), '4');

INSERT INTO ACL_GROUP_PERMISSION (ACL_GROUP_ID, CLASS_ID, PERMISSION_MASK) VALUES ((select ID from ACL_GROUP where QUALIFIED_NAME = 'squashtest.acl.group.tm.ProjectManager'), (select ID from ACL_CLASS where CLASSNAME = 'org.squashtest.csp.tm.domain.project.Project'), '8');

INSERT INTO ACL_GROUP (QUALIFIED_NAME) VALUES ('squashtest.acl.group.tm.TestEditor');

INSERT INTO ACL_GROUP_PERMISSION (ACL_GROUP_ID, CLASS_ID, PERMISSION_MASK) VALUES ((select ID from ACL_GROUP where QUALIFIED_NAME = 'squashtest.acl.group.tm.TestEditor'), (select ID from ACL_CLASS where CLASSNAME = 'org.squashtest.csp.tm.domain.project.Project'), '15');

INSERT INTO ACL_GROUP_PERMISSION (ACL_GROUP_ID, CLASS_ID, PERMISSION_MASK) VALUES ((select ID from ACL_GROUP where QUALIFIED_NAME = 'squashtest.acl.group.tm.TestEditor'), (select ID from ACL_CLASS where CLASSNAME = 'org.squashtest.csp.tm.domain.project.Project'), '1');

INSERT INTO ACL_GROUP_PERMISSION (ACL_GROUP_ID, CLASS_ID, PERMISSION_MASK) VALUES ((select ID from ACL_GROUP where QUALIFIED_NAME = 'squashtest.acl.group.tm.TestEditor'), (select ID from ACL_CLASS where CLASSNAME = 'org.squashtest.csp.tm.domain.project.Project'), '2');

INSERT INTO ACL_GROUP_PERMISSION (ACL_GROUP_ID, CLASS_ID, PERMISSION_MASK) VALUES ((select ID from ACL_GROUP where QUALIFIED_NAME = 'squashtest.acl.group.tm.TestEditor'), (select ID from ACL_CLASS where CLASSNAME = 'org.squashtest.csp.tm.domain.project.Project'), '4');

INSERT INTO ACL_GROUP_PERMISSION (ACL_GROUP_ID, CLASS_ID, PERMISSION_MASK) VALUES ((select ID from ACL_GROUP where QUALIFIED_NAME = 'squashtest.acl.group.tm.TestEditor'), (select ID from ACL_CLASS where CLASSNAME = 'org.squashtest.csp.tm.domain.project.Project'), '8');

INSERT INTO ACL_GROUP (QUALIFIED_NAME) VALUES ('squashtest.acl.group.tm.TestRunner');

INSERT INTO ACL_GROUP_PERMISSION (ACL_GROUP_ID, CLASS_ID, PERMISSION_MASK) VALUES ((select ID from ACL_GROUP where QUALIFIED_NAME = 'squashtest.acl.group.tm.TestRunner'), (select ID from ACL_CLASS where CLASSNAME = 'org.squashtest.csp.tm.domain.project.Project'), '1');

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('gfouquet', '', NOW(), 'Insert Row (x20)', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.44', '2.0.5', '3:67ee96d82ee3e4cc07bf2c0e252cee36', 53);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml::tm-0.14.0.45::gfouquet::(Checksum: 3:17d0e76b39bf9550b5d66f84108de444)
INSERT INTO ACL_GROUP (QUALIFIED_NAME) VALUES ('squashtest.acl.group.tm.ProjectViewer');

INSERT INTO ACL_GROUP_PERMISSION (ACL_GROUP_ID, CLASS_ID, PERMISSION_MASK) VALUES ((select ID from ACL_GROUP where QUALIFIED_NAME = 'squashtest.acl.group.tm.ProjectViewer'), (select ID from ACL_CLASS where CLASSNAME = 'org.squashtest.csp.tm.domain.project.Project'), '1');

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('gfouquet', '', NOW(), 'Insert Row (x2)', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/tm/tm.changelog-0.15.0.xml', 'tm-0.14.0.45', '2.0.5', '3:17d0e76b39bf9550b5d66f84108de444', 54);

-- Changeset /var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/auth/auth.changelog-1.0.xml::1::gfouquet::(Checksum: 3:c3f1c8c5573dd761b4aa35d473b1db7d)
CREATE TABLE AUTH_USER (LOGIN VARCHAR(50) NOT NULL, PASSWORD CHAR(40) NOT NULL, ACTIVE BOOLEAN DEFAULT TRUE NOT NULL, CONSTRAINT PK_AUTH_USER PRIMARY KEY (LOGIN));

CREATE UNIQUE INDEX IDX_AUTHENTICATION ON AUTH_USER(LOGIN);

INSERT INTO AUTH_USER (ACTIVE, LOGIN, PASSWORD) VALUES (TRUE, 'admin', 'd033e22ae348aeb5660fc2140aec35850c4da997');

INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES ('gfouquet', '', NOW(), 'Create Table, Create Index, Insert Row', 'EXECUTED', '/var/lib/jenkins/jobs/build-squash-tm-distros/workspace/standalone/target/maven-shared-archive-resources/auth/auth.changelog-1.0.xml', '1', '2.0.5', '3:c3f1c8c5573dd761b4aa35d473b1db7d', 55);

-- Release Database Lock
-- Release Database Lock
