-- SQL statements which are executed at application startup if hibernate.hbm2ddl.auto is 'create' or 'create-drop'

UPDATE "sys_config" SET actor = 'XCA Responding Gateway';
UPDATE "xca_message" SET is_gazelle_driven = false;

INSERT INTO "tf_transaction" (id, description, keyword, name) VALUES ('4',	'Registry Stored Query',	'ITI-18',	'Registry Stored Query');
INSERT INTO "tf_transaction" (id, description, keyword, name) VALUES ('5',	'Retrieve Document Set',	'ITI-43',	'Retrieve Document Set');

SELECT pg_catalog.setval('tf_transaction_id_seq', 5 , true);

INSERT INTO "affinity_domain" (id, label_to_display, profile, keyword) VALUES ('3',	'IHE','XDS-b', 'IHE_XDS-b');

SELECT pg_catalog.setval('affinity_domain_id_seq', 3 , true);

INSERT INTO "affinity_domain_transactions" (affinity_domain_id, transaction_id) VALUES ('3', '4');
INSERT INTO "affinity_domain_transactions" (affinity_domain_id, transaction_id) VALUES ('3', '5');

INSERT INTO "message_type" (id, name, uuid, transaction_id, action) VALUES ('19', 'FindDocuments', 'urn:uuid:14d4debf-8f97-4251-9a74-a90016b0af0d', '4', 'urn:ihe:iti:2007:RegistryStoredQuery');
INSERT INTO "message_type" (id, name, uuid, transaction_id, action) VALUES ('20', 'FindSubmissionSets', 'urn:uuid:f26abbcb-ac74-4422-8a30-edb644bbc1a9', '4', 'urn:ihe:iti:2007:RegistryStoredQuery');
INSERT INTO "message_type" (id, name, uuid, transaction_id, action) VALUES ('21', 'FindFolders', 'urn:uuid:958f3006-baad-4929-a4de-ff1114824431', '4', 'urn:ihe:iti:2007:RegistryStoredQuery');
INSERT INTO "message_type" (id, name, uuid, transaction_id, action) VALUES ('22', 'GetAll', 'urn:uuid:10b545ea-725c-446d-9b95-8aeb444eddf3', '4', 'urn:ihe:iti:2007:RegistryStoredQuery');
INSERT INTO "message_type" (id, name, uuid, transaction_id, action) VALUES ('23', 'GetDocuments', 'urn:uuid:5c4f972b-d56b-40ac-a5fc-c8ca9b40b9d4', '4', 'urn:ihe:iti:2007:RegistryStoredQuery');
INSERT INTO "message_type" (id, name, uuid, transaction_id, action) VALUES ('24', 'GetFolders', 'urn:uuid:5737b14c-8a1a-4539-b659-e03a34a5e1e4', '4', 'urn:ihe:iti:2007:RegistryStoredQuery');
INSERT INTO "message_type" (id, name, uuid, transaction_id, action) VALUES ('25', 'GetAssociations', 'urn:uuid:a7ae438b-4bc2-4642-93e9-be891f7bb155', '4', 'urn:ihe:iti:2007:RegistryStoredQuery');
INSERT INTO "message_type" (id, name, uuid, transaction_id, action) VALUES ('26', 'GetDocumentsAndAssociations', 'urn:uuid:bab9529a-4a10-40b3-a01f-f68a615d247a', '4', 'urn:ihe:iti:2007:RegistryStoredQuery');
INSERT INTO "message_type" (id, name, uuid, transaction_id, action) VALUES ('27', 'GetSubmissionSets', 'urn:uuid:51224314-5390-4169-9b91-b1980040715a', '4', 'urn:ihe:iti:2007:RegistryStoredQuery');
INSERT INTO "message_type" (id, name, uuid, transaction_id, action) VALUES ('28','GetSubmissionSetAndContents', 'urn:uuid:e8e3cb2c-e39c-46b9-99e4-c12f57260b83', '4', 'urn:ihe:iti:2007:RegistryStoredQuery');
INSERT INTO "message_type" (id, name, uuid, transaction_id, action) VALUES ('29','GetFoldersAndContents', 'urn:uuid:b909a503-523d-4517-8acf-8e5834dfc4c7', '4', 'urn:ihe:iti:2007:RegistryStoredQuery');
INSERT INTO "message_type" (id, name, uuid, transaction_id, action) VALUES ('30','GetFoldersForDocument', 'urn:uuid:10cae35a-c7f9-4cf5-b61e-fc3278ffb578', '4', 'urn:ihe:iti:2007:RegistryStoredQuery');
INSERT INTO "message_type" (id, name, uuid, transaction_id, action) VALUES ('31','GetRelatedDocuments', 'urn:uuid:d90e5407-b356-4d91-a89f-873917b4b0e6', '4', 'urn:ihe:iti:2007:RegistryStoredQuery');
INSERT INTO "message_type" (id, name, uuid, transaction_id, action) VALUES ('32','RetrieveDocumentSet', null, '5', 'urn:ihe:iti:2007:RetrieveDocumentSet');

SELECT pg_catalog.setval('message_type_id_seq', 32 , true);

INSERT INTO "message_type_required_parameters" (message_type_id, parameter_id) VALUES ('19', '1');
INSERT INTO "message_type_required_parameters" (message_type_id, parameter_id) VALUES ('19', '17');
INSERT INTO "message_type_required_parameters" (message_type_id, parameter_id) VALUES ('20', '18');
INSERT INTO "message_type_required_parameters" (message_type_id, parameter_id) VALUES ('20', '24');
INSERT INTO "message_type_required_parameters" (message_type_id, parameter_id) VALUES ('21', '25');
INSERT INTO "message_type_required_parameters" (message_type_id, parameter_id) VALUES ('21', '29');
INSERT INTO "message_type_required_parameters" (message_type_id, parameter_id) VALUES ('22', '30');
INSERT INTO "message_type_required_parameters" (message_type_id, parameter_id) VALUES ('22', '17');
INSERT INTO "message_type_required_parameters" (message_type_id, parameter_id) VALUES ('22', '24');
INSERT INTO "message_type_required_parameters" (message_type_id, parameter_id) VALUES ('22', '29');
INSERT INTO "message_type_required_parameters" (message_type_id, parameter_id) VALUES ('25', '36');
INSERT INTO "message_type_required_parameters" (message_type_id, parameter_id) VALUES ('27', '36');
INSERT INTO "message_type_required_parameters" (message_type_id, parameter_id) VALUES ('31', '39');
INSERT INTO "message_type_required_parameters" (message_type_id, parameter_id) VALUES ('32', '40');
INSERT INTO "message_type_required_parameters" (message_type_id, parameter_id) VALUES ('32', '41');
INSERT INTO "message_type_required_parameters" (message_type_id, parameter_id) VALUES ('32', '42');

INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('19', '2');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('19', '3');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('19', '4');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('19', '5');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('19', '6');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('19', '7');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('19', '8');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('19', '10');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('19', '11');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('19', '12');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('19', '13');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('19', '14');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('19', '15');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('19', '16');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('20', '19');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('20', '20');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('20', '21');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('20', '22');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('20', '23');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('21', '26');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('21', '27');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('21', '28');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('22', '16');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('22', '14');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('23', '31');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('23', '32');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('23', '33');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('24', '34');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('24', '35');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('24', '33');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('25', '33');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('26', '31');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('26', '32');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('26', '33');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('27', '33');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('28', '33');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('28', '37');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('28', '38');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('28', '14');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('28', '16');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('29', '33');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('29', '34');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('29', '35');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('29', '14');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('29', '16');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('30', '33');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('30', '31');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('30', '32');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('31', '33');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('31', '31');
INSERT INTO "message_type_optional_parameters" (message_type_id, parameter_id) VALUES ('31', '32');

insert into user_account (id, username, password_hash, enabled) values (2, 'epoiseau', 'Ss/jICpf9c9GeJj8WKqx1hUClEE=', true);
insert into user_account (id, username, password_hash, enabled) values (3, 'aberge', 'Ss/jICpf9c9GeJj8WKqx1hUClEE=', true);

insert into user_account_role (account_id, member_of_role) values (2, 1);
insert into user_account_role (account_id, member_of_role) values (3, 1);

SELECT pg_catalog.setval('user_account_id_seq', 3, true);

INSERT INTO gs_test_instance_status(id, keyword, label_to_display, description) VALUES (1, 'started', 'started', 'started');
INSERT INTO gs_test_instance_status(id, keyword, label_to_display, description) VALUES (2, 'completed', 'completed', 'completed');
SELECT pg_catalog.setval('gs_test_instance_status_id_seq', 2, true);

