-- *********************************************************************
-- Update Database Script
-- *********************************************************************
-- Change Log: META-INF/jpa-changelog-master.xml
-- Ran at: 2/1/17 7:59 AM
-- Against: dballo13@jdbc:edb://db-32.rhev-ci-vms.eng.rdu2.redhat.com:5432/dballo13
-- Liquibase version: 3.4.1
-- *********************************************************************

-- Changeset META-INF/db2-jpa-changelog-1.0.0.Final.xml::1.0.0.Final::sthorger@redhat.com
INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('1.0.0.Final', 'sthorger@redhat.com', 'META-INF/db2-jpa-changelog-1.0.0.Final.xml', NOW(), 20, '7:f061c3934594ee60a9b2343f5100ae4e', 'createTable (x29), addPrimaryKey (x21), addUniqueConstraint (x6), addForeignKeyConstraint (x30)', '', 'MARK_RAN', NULL, NULL, '3.4.1');

-- Changeset META-INF/db2-jpa-changelog-1.2.0.Beta1.xml::1.2.0.Beta1::psilva@redhat.com
INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('1.2.0.Beta1', 'psilva@redhat.com', 'META-INF/db2-jpa-changelog-1.2.0.Beta1.xml', NOW(), 21, '7:2e01012df20974c1c2a605ef8afe25b7', 'delete (x4), createTable (x8), addColumn (x2), addPrimaryKey (x6), addForeignKeyConstraint (x9), addUniqueConstraint (x2), addColumn, dropForeignKeyConstraint (x2), dropUniqueConstraint, renameColumn (x3), customChange, dropForeignKeyConstraint, d...', '', 'MARK_RAN', NULL, NULL, '3.4.1');

-- Changeset META-INF/db2-jpa-changelog-1.2.0.CR1.xml::1.2.0.RC1::bburke@redhat.com
INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('1.2.0.RC1', 'bburke@redhat.com', 'META-INF/db2-jpa-changelog-1.2.0.CR1.xml', NOW(), 22, '7:a77ea2ad226b345e7d689d366f185c8c', 'delete (x5), createTable (x3), addColumn, createTable (x4), addPrimaryKey (x7), addForeignKeyConstraint (x6), renameColumn, addUniqueConstraint, addColumn (x2), update, dropColumn, dropForeignKeyConstraint, renameColumn, addForeignKeyConstraint, r...', '', 'MARK_RAN', NULL, NULL, '3.4.1');

-- Changeset META-INF/db2-jpa-changelog-1.4.0.xml::1.4.0::bburke@redhat.com
INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('1.4.0', 'bburke@redhat.com', 'META-INF/db2-jpa-changelog-1.4.0.xml', NOW(), 23, '7:d909180b2530479a716d3f9c9eaea3d7', 'delete (x7), addColumn (x5), dropColumn, renameTable, dropForeignKeyConstraint, renameTable, addForeignKeyConstraint, update (x10), createTable (x3), customChange, dropPrimaryKey, addPrimaryKey (x4), addForeignKeyConstraint (x2), dropColumn, addCo...', '', 'MARK_RAN', NULL, NULL, '3.4.1');

-- Changeset META-INF/db2-jpa-changelog-1.8.0.xml::1.8.0::mposolda@redhat.com
INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('1.8.0', 'mposolda@redhat.com', 'META-INF/db2-jpa-changelog-1.8.0.xml', NOW(), 24, '7:f987971fe6b37d963bc95fee2b27f8df', 'addColumn, createTable (x3), dropNotNullConstraint, addColumn (x2), createTable, addPrimaryKey, addUniqueConstraint, addForeignKeyConstraint (x5), addPrimaryKey, addForeignKeyConstraint (x2), addPrimaryKey, addForeignKeyConstraint, update', '', 'MARK_RAN', NULL, NULL, '3.4.1');

-- Changeset META-INF/db2-jpa-changelog-1.8.0.xml::1.8.0-2::keycloak
INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('1.8.0-2', 'keycloak', 'META-INF/db2-jpa-changelog-1.8.0.xml', NOW(), 25, '7:df8bc21027a4f7cbbb01f6344e89ce07', 'dropDefaultValue, update', '', 'MARK_RAN', NULL, NULL, '3.4.1');

-- Changeset META-INF/db2-jpa-changelog-1.9.1.xml::1.9.1::keycloak
INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('1.9.1', 'keycloak', 'META-INF/db2-jpa-changelog-1.9.1.xml', NOW(), 26, '7:1437310ed1305a9b93f8848f301726ce', 'modifyDataType (x2)', '', 'MARK_RAN', NULL, NULL, '3.4.1');

-- Changeset META-INF/jpa-changelog-authz-2.0.0.xml::authz-2.0.0::psilva@redhat.com
CREATE TABLE public.RESOURCE_SERVER (ID VARCHAR(36) NOT NULL, CLIENT_ID VARCHAR(36) NOT NULL, ALLOW_RS_REMOTE_MGMT BOOLEAN DEFAULT FALSE NOT NULL, POLICY_ENFORCE_MODE VARCHAR(15) NOT NULL);

ALTER TABLE public.RESOURCE_SERVER ADD CONSTRAINT CONSTRAINT_FARS PRIMARY KEY (ID);

ALTER TABLE public.RESOURCE_SERVER ADD CONSTRAINT UK_AU8TT6T700S9V50BU18WS5HA6 UNIQUE (CLIENT_ID);

CREATE TABLE public.RESOURCE_SERVER_RESOURCE (ID VARCHAR(36) NOT NULL, NAME VARCHAR(255) NOT NULL, URI VARCHAR(255), TYPE VARCHAR(255), ICON_URI VARCHAR(255), OWNER VARCHAR(36) NOT NULL, RESOURCE_SERVER_ID VARCHAR(36) NOT NULL);

ALTER TABLE public.RESOURCE_SERVER_RESOURCE ADD CONSTRAINT CONSTRAINT_FARSR PRIMARY KEY (ID);

ALTER TABLE public.RESOURCE_SERVER_RESOURCE ADD CONSTRAINT FK_FRSRHO213XCX4WNKOG82SSRFY FOREIGN KEY (RESOURCE_SERVER_ID) REFERENCES public.RESOURCE_SERVER (ID);

ALTER TABLE public.RESOURCE_SERVER_RESOURCE ADD CONSTRAINT UK_FRSR6T700S9V50BU18WS5HA6 UNIQUE (NAME, OWNER, RESOURCE_SERVER_ID);

CREATE TABLE public.RESOURCE_SERVER_SCOPE (ID VARCHAR(36) NOT NULL, NAME VARCHAR(255) NOT NULL, ICON_URI VARCHAR(255), RESOURCE_SERVER_ID VARCHAR(36) NOT NULL);

ALTER TABLE public.RESOURCE_SERVER_SCOPE ADD CONSTRAINT CONSTRAINT_FARSRS PRIMARY KEY (ID);

ALTER TABLE public.RESOURCE_SERVER_SCOPE ADD CONSTRAINT FK_FRSRSO213XCX4WNKOG82SSRFY FOREIGN KEY (RESOURCE_SERVER_ID) REFERENCES public.RESOURCE_SERVER (ID);

ALTER TABLE public.RESOURCE_SERVER_SCOPE ADD CONSTRAINT UK_FRSRST700S9V50BU18WS5HA6 UNIQUE (NAME, RESOURCE_SERVER_ID);

CREATE TABLE public.RESOURCE_SERVER_POLICY (ID VARCHAR(36) NOT NULL, NAME VARCHAR(255) NOT NULL, DESCRIPTION VARCHAR(255), TYPE VARCHAR(255) NOT NULL, DECISION_STRATEGY VARCHAR(20), LOGIC VARCHAR(20), RESOURCE_SERVER_ID VARCHAR(36) NOT NULL);

ALTER TABLE public.RESOURCE_SERVER_POLICY ADD CONSTRAINT CONSTRAINT_FARSRP PRIMARY KEY (ID);

ALTER TABLE public.RESOURCE_SERVER_POLICY ADD CONSTRAINT FK_FRSRPO213XCX4WNKOG82SSRFY FOREIGN KEY (RESOURCE_SERVER_ID) REFERENCES public.RESOURCE_SERVER (ID);

ALTER TABLE public.RESOURCE_SERVER_POLICY ADD CONSTRAINT UK_FRSRPT700S9V50BU18WS5HA6 UNIQUE (NAME, RESOURCE_SERVER_ID);

CREATE TABLE public.POLICY_CONFIG (POLICY_ID VARCHAR(36) NOT NULL, NAME VARCHAR(255) NOT NULL, VALUE TEXT);

ALTER TABLE public.POLICY_CONFIG ADD CONSTRAINT CONSTRAINT_DPC PRIMARY KEY (POLICY_ID, NAME);

ALTER TABLE public.POLICY_CONFIG ADD CONSTRAINT FKDC34197CF864C4E43 FOREIGN KEY (POLICY_ID) REFERENCES public.RESOURCE_SERVER_POLICY (ID);

CREATE TABLE public.RESOURCE_SCOPE (RESOURCE_ID VARCHAR(36) NOT NULL, SCOPE_ID VARCHAR(36) NOT NULL);

ALTER TABLE public.RESOURCE_SCOPE ADD CONSTRAINT CONSTRAINT_FARSRSP PRIMARY KEY (RESOURCE_ID, SCOPE_ID);

ALTER TABLE public.RESOURCE_SCOPE ADD CONSTRAINT FK_FRSRPOS13XCX4WNKOG82SSRFY FOREIGN KEY (RESOURCE_ID) REFERENCES public.RESOURCE_SERVER_RESOURCE (ID);

ALTER TABLE public.RESOURCE_SCOPE ADD CONSTRAINT FK_FRSRPS213XCX4WNKOG82SSRFY FOREIGN KEY (SCOPE_ID) REFERENCES public.RESOURCE_SERVER_SCOPE (ID);

CREATE TABLE public.RESOURCE_POLICY (RESOURCE_ID VARCHAR(36) NOT NULL, POLICY_ID VARCHAR(36) NOT NULL);

ALTER TABLE public.RESOURCE_POLICY ADD CONSTRAINT CONSTRAINT_FARSRPP PRIMARY KEY (RESOURCE_ID, POLICY_ID);

ALTER TABLE public.RESOURCE_POLICY ADD CONSTRAINT FK_FRSRPOS53XCX4WNKOG82SSRFY FOREIGN KEY (RESOURCE_ID) REFERENCES public.RESOURCE_SERVER_RESOURCE (ID);

ALTER TABLE public.RESOURCE_POLICY ADD CONSTRAINT FK_FRSRPP213XCX4WNKOG82SSRFY FOREIGN KEY (POLICY_ID) REFERENCES public.RESOURCE_SERVER_POLICY (ID);

CREATE TABLE public.SCOPE_POLICY (SCOPE_ID VARCHAR(36) NOT NULL, POLICY_ID VARCHAR(36) NOT NULL);

ALTER TABLE public.SCOPE_POLICY ADD CONSTRAINT CONSTRAINT_FARSRSPS PRIMARY KEY (SCOPE_ID, POLICY_ID);

ALTER TABLE public.SCOPE_POLICY ADD CONSTRAINT FK_FRSRPASS3XCX4WNKOG82SSRFY FOREIGN KEY (SCOPE_ID) REFERENCES public.RESOURCE_SERVER_SCOPE (ID);

ALTER TABLE public.SCOPE_POLICY ADD CONSTRAINT FK_FRSRASP13XCX4WNKOG82SSRFY FOREIGN KEY (POLICY_ID) REFERENCES public.RESOURCE_SERVER_POLICY (ID);

CREATE TABLE public.ASSOCIATED_POLICY (POLICY_ID VARCHAR(36) NOT NULL, ASSOCIATED_POLICY_ID VARCHAR(36) NOT NULL);

ALTER TABLE public.ASSOCIATED_POLICY ADD CONSTRAINT CONSTRAINT_FARSRPAP PRIMARY KEY (POLICY_ID, ASSOCIATED_POLICY_ID);

ALTER TABLE public.ASSOCIATED_POLICY ADD CONSTRAINT FK_FRSRPAS14XCX4WNKOG82SSRFY FOREIGN KEY (POLICY_ID) REFERENCES public.RESOURCE_SERVER_POLICY (ID);

ALTER TABLE public.ASSOCIATED_POLICY ADD CONSTRAINT FK_FRSR5S213XCX4WNKOG82SSRFY FOREIGN KEY (ASSOCIATED_POLICY_ID) REFERENCES public.RESOURCE_SERVER_POLICY (ID);

INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('authz-2.0.0', 'psilva@redhat.com', 'META-INF/jpa-changelog-authz-2.0.0.xml', NOW(), 27, '7:9cc98082921330d8d9266decdd4bd658', 'createTable, addPrimaryKey, addUniqueConstraint, createTable, addPrimaryKey, addForeignKeyConstraint, addUniqueConstraint, createTable, addPrimaryKey, addForeignKeyConstraint, addUniqueConstraint, createTable, addPrimaryKey, addForeignKeyConstrain...', '', 'EXECUTED', NULL, NULL, '3.4.1');

-- Changeset META-INF/jpa-changelog-authz-2.5.1.xml::authz-2.5.1::psilva@redhat.com
UPDATE public.RESOURCE_SERVER_POLICY SET TYPE = 'rules' WHERE TYPE = 'drools';

INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('authz-2.5.1', 'psilva@redhat.com', 'META-INF/jpa-changelog-authz-2.5.1.xml', NOW(), 28, '7:03d64aeed9cb52b969bd30a7ac0db57e', 'update', '', 'EXECUTED', NULL, NULL, '3.4.1');

-- Changeset META-INF/jpa-changelog-2.1.0.xml::2.1.0::bburke@redhat.com
CREATE TABLE public.BROKER_LINK (IDENTITY_PROVIDER VARCHAR(255) NOT NULL, STORAGE_PROVIDER_ID VARCHAR(255), REALM_ID VARCHAR(36) NOT NULL, BROKER_USER_ID VARCHAR(255), BROKER_USERNAME VARCHAR(255), TOKEN TEXT, USER_ID VARCHAR(255) NOT NULL);

CREATE TABLE public.FED_USER_ATTRIBUTE (ID VARCHAR(36) NOT NULL, NAME VARCHAR(255) NOT NULL, USER_ID VARCHAR(255) NOT NULL, REALM_ID VARCHAR(36) NOT NULL, STORAGE_PROVIDER_ID VARCHAR(36), VALUE VARCHAR(2024));

CREATE TABLE public.FED_USER_CONSENT (ID VARCHAR(36) NOT NULL, CLIENT_ID VARCHAR(36) NOT NULL, USER_ID VARCHAR(255) NOT NULL, REALM_ID VARCHAR(36) NOT NULL, STORAGE_PROVIDER_ID VARCHAR(36));

CREATE TABLE public.FED_USER_CONSENT_ROLE (USER_CONSENT_ID VARCHAR(36) NOT NULL, ROLE_ID VARCHAR(36) NOT NULL);

CREATE TABLE public.FED_USER_CONSENT_PROT_MAPPER (USER_CONSENT_ID VARCHAR(36) NOT NULL, PROTOCOL_MAPPER_ID VARCHAR(36) NOT NULL);

CREATE TABLE public.FED_USER_CREDENTIAL (ID VARCHAR(36) NOT NULL, DEVICE VARCHAR(255), HASH_ITERATIONS INT, SALT BYTEA, TYPE VARCHAR(255), VALUE VARCHAR(255), CREATED_DATE BIGINT, COUNTER INT DEFAULT 0, DIGITS INT DEFAULT 6, PERIOD INT DEFAULT 30, ALGORITHM VARCHAR(36) DEFAULT 'HmacSHA1', USER_ID VARCHAR(255) NOT NULL, REALM_ID VARCHAR(36) NOT NULL, STORAGE_PROVIDER_ID VARCHAR(36));

CREATE TABLE public.FED_USER_GROUP_MEMBERSHIP (GROUP_ID VARCHAR(36) NOT NULL, USER_ID VARCHAR(255) NOT NULL, REALM_ID VARCHAR(36) NOT NULL, STORAGE_PROVIDER_ID VARCHAR(36));

CREATE TABLE public.FED_USER_REQUIRED_ACTION (REQUIRED_ACTION VARCHAR(255) DEFAULT ' ' NOT NULL, USER_ID VARCHAR(255) NOT NULL, REALM_ID VARCHAR(36) NOT NULL, STORAGE_PROVIDER_ID VARCHAR(36));

CREATE TABLE public.FED_USER_ROLE_MAPPING (ROLE_ID VARCHAR(36) NOT NULL, USER_ID VARCHAR(255) NOT NULL, REALM_ID VARCHAR(36) NOT NULL, STORAGE_PROVIDER_ID VARCHAR(36));

CREATE TABLE public.COMPONENT_CONFIG (ID VARCHAR(36) NOT NULL, COMPONENT_ID VARCHAR(36) NOT NULL, NAME VARCHAR(255) NOT NULL, VALUE VARCHAR(4000));

CREATE TABLE public.COMPONENT (ID VARCHAR(36) NOT NULL, NAME VARCHAR(255), PARENT_ID VARCHAR(36), PROVIDER_ID VARCHAR(36), PROVIDER_TYPE VARCHAR(255), REALM_ID VARCHAR(36));

ALTER TABLE public.BROKER_LINK ADD CONSTRAINT CONSTR_BROKER_LINK_PK PRIMARY KEY (IDENTITY_PROVIDER, USER_ID);

ALTER TABLE public.FED_USER_ATTRIBUTE ADD CONSTRAINT CONSTR_FED_USER_ATTR_PK PRIMARY KEY (ID);

ALTER TABLE public.FED_USER_CONSENT ADD CONSTRAINT CONSTR_FED_USER_CONSENT_PK PRIMARY KEY (ID);

ALTER TABLE public.FED_USER_CONSENT_ROLE ADD CONSTRAINT CONSTR_USER_CONSENT_ROLE_PK PRIMARY KEY (USER_CONSENT_ID, ROLE_ID);

ALTER TABLE public.FED_USER_CONSENT_PROT_MAPPER ADD CONSTRAINT CONSTR_USER_CONSENT_PROTM_PK PRIMARY KEY (USER_CONSENT_ID, PROTOCOL_MAPPER_ID);

ALTER TABLE public.FED_USER_CREDENTIAL ADD CONSTRAINT CONSTR_FED_USER_CRED_PK PRIMARY KEY (ID);

ALTER TABLE public.FED_USER_GROUP_MEMBERSHIP ADD CONSTRAINT CONSTR_FED_USER_GROUP PRIMARY KEY (GROUP_ID, USER_ID);

ALTER TABLE public.FED_USER_ROLE_MAPPING ADD CONSTRAINT CONSTR_FED_USER_ROLE PRIMARY KEY (ROLE_ID, USER_ID);

ALTER TABLE public.FED_USER_REQUIRED_ACTION ADD CONSTRAINT CONSTR_FED_REQUIRED_ACTION PRIMARY KEY (REQUIRED_ACTION, USER_ID);

ALTER TABLE public.COMPONENT ADD CONSTRAINT CONSTR_COMPONENT_PK PRIMARY KEY (ID);

ALTER TABLE public.COMPONENT_CONFIG ADD CONSTRAINT CONSTR_COMPONENT_CONFIG_PK PRIMARY KEY (ID);

ALTER TABLE public.COMPONENT ADD CONSTRAINT FK_COMPONENT_REALM FOREIGN KEY (REALM_ID) REFERENCES public.REALM (ID);

ALTER TABLE public.COMPONENT_CONFIG ADD CONSTRAINT FK_COMPONENT_CONFIG FOREIGN KEY (COMPONENT_ID) REFERENCES public.COMPONENT (ID);

INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('2.1.0', 'bburke@redhat.com', 'META-INF/jpa-changelog-2.1.0.xml', NOW(), 29, '7:e01599a82bf8d6dc22a9da506e22e868', 'createTable (x11), addPrimaryKey (x11), addForeignKeyConstraint (x2)', '', 'EXECUTED', NULL, NULL, '3.4.1');

-- Changeset META-INF/jpa-changelog-2.2.0.xml::2.2.0::bburke@redhat.com
ALTER TABLE public.ADMIN_EVENT_ENTITY ADD RESOURCE_TYPE VARCHAR(64);

CREATE TABLE public.CREDENTIAL_ATTRIBUTE (ID VARCHAR(36) NOT NULL, CREDENTIAL_ID VARCHAR(36) NOT NULL, NAME VARCHAR(255) NOT NULL, VALUE VARCHAR(4000));

CREATE TABLE public.FED_CREDENTIAL_ATTRIBUTE (ID VARCHAR(36) NOT NULL, CREDENTIAL_ID VARCHAR(36) NOT NULL, NAME VARCHAR(255) NOT NULL, VALUE VARCHAR(4000));

ALTER TABLE public.CREDENTIAL ALTER COLUMN VALUE TYPE VARCHAR(4000) USING (VALUE::VARCHAR(4000));

ALTER TABLE public.FED_CREDENTIAL_ATTRIBUTE ADD CONSTRAINT FK_FED_CRED_ATTR FOREIGN KEY (CREDENTIAL_ID) REFERENCES public.FED_USER_CREDENTIAL (ID);

ALTER TABLE public.CREDENTIAL_ATTRIBUTE ADD CONSTRAINT FK_CRED_ATTR FOREIGN KEY (CREDENTIAL_ID) REFERENCES public.CREDENTIAL (ID);

INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('2.2.0', 'bburke@redhat.com', 'META-INF/jpa-changelog-2.2.0.xml', NOW(), 30, '7:53188c3eb1107546e6f765835705b6c1', 'addColumn, createTable (x2), modifyDataType, addForeignKeyConstraint (x2)', '', 'EXECUTED', NULL, NULL, '3.4.1');

-- Changeset META-INF/jpa-changelog-2.3.0.xml::2.3.0::bburke@redhat.com
CREATE TABLE public.FEDERATED_USER (ID VARCHAR(255) NOT NULL, STORAGE_PROVIDER_ID VARCHAR(255), REALM_ID VARCHAR(36) NOT NULL);

ALTER TABLE public.FEDERATED_USER ADD CONSTRAINT CONSTR_FEDERATED_USER PRIMARY KEY (ID);

ALTER TABLE public.USER_ENTITY ALTER COLUMN  TOTP SET DEFAULT NULL;

ALTER TABLE public.USER_ENTITY DROP COLUMN TOTP;

ALTER TABLE public.IDENTITY_PROVIDER ADD PROVIDER_DISPLAY_NAME VARCHAR(255);

ALTER TABLE public.COMPONENT ADD SUB_TYPE VARCHAR(255);

INSERT INTO public.component (ID, REALM_ID, PARENT_ID, NAME, PROVIDER_ID, PROVIDER_TYPE) VALUES ('2dd71feb-33e7-4e7f-9072-bcc67a541f35', 'master', 'master', 'rsa', 'rsa', 'org.keycloak.keys.KeyProvider');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('b306c659-7c6e-425a-a6ab-7adf9cfe40f2', '2dd71feb-33e7-4e7f-9072-bcc67a541f35', 'priority', '100');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('18362216-fb38-4947-81c9-e6fd15557322', '2dd71feb-33e7-4e7f-9072-bcc67a541f35', 'privateKey', 'MIIEowIBAAKCAQEAiU54OXoCbHy0L0gHn1yasctcnKHRU1pHFIJnWvaI7rClJydet9dDJaiYXOxMKseiBm3eYznfN3cPyU8udYmRnMuKjiocZ77LT2IEttAjXb6Ggazx7loriFHRy0IOJeX4KxXhAPWmxqa3mkFNfLBEvFqVaBgUDHQ60cmnPvNSHYudBTW9K80s8nvmP2pso7HTwWJ1+Xatj1Ey/gTmB3CXlyqBegGWC9TeuErEYpYhdh+11TVWasgMBZyUCtL3NRPaBuhaPg1LpW8lWGk05nS+YM6dvTk3Mppv+z2RygEpxyO09oT3b4G+Zfwit1STqn0AvDTGzINdoKcNtFScV0j8TwIDAQABAoIBAHcbPKsPLZ8SJfOF1iblW8OzFulAbaaSf2pJHIMJrQrw7LKkMkPjVXoLX+/rgr7xYZmWIP2OLBWfEHCeYTzQUyHiZpSf7vgHx7Fa45/5uVQOe/ttHIiYa37bCtP4vvEdJkOpvP7qGPvljwsebqsk9Ns28LfVez66bHOjK5Mt2yOIulbTeEs7ch//h39YwKJv96vc+CHbV2O6qoOxZessO6y+287cOBvbFXmS2GaGle5Nx/EwncBNS4b7czoetmm70+9ht3yX+kxaP311YUT31KQjuaJt275kOiKsrXr27PvgO++bsIyGuSzqyS7G7fmxF2zUyphEqEpalyDGMKMnrAECgYEA1fCgFox03rPDjm0MhW/ThoS2Ld27sbWQ6reS+PBMdUTJZVZIU1D2//h6VXDnlddhk6avKjA4smdy1aDKzmjz3pt9AKn+kgkXqtTC2fD3wp+fC9hND0z+rQPGe/Gk7ZUnTdsqnfyowxr+woIgzdnRukOUrG+xQiP3RUUT7tt6NQECgYEApEz2xvgqMm+9/f/YxjLdsFUfLqc4WlafB863stYEVqlCYy5ujyo0VQ0ahKSKJkLDnf52+aMUqPOpwaGePpu3O6VkvpcKfPY2MUlZW7/6Sa9et9hxNkdTS7Gui2d1ELpaCBe1Bc62sk8EA01iHXE1PpvyUqDWrhNh+NrDICA9oU8CgYBgGDYACtTP11TmW2r9YK5VRLUDww30k4ZlN1GnyV++aMhBYVEZQ0u+y+A/EnijIFwu0vbo70H4OGknNZMCxbeMbLDoJHM5KyZbUDe5ZvgSjloFGwH59m6KTiDQOUkIgi9mVCQ/VGaFRFHcElEjxUvj60kTbxPijn8ZuR5r8l9hAQKBgQCQ9jL5pHWeoIayN20smi6M6N2lTPbkhe60dcgQatHTIG2pkosLl8IqlHAkPgSB84AiwyR351JQKwRJCm7TcJI/dxMnMZ6YWKfB3qSP1hdfsfJRJQ/mQxIUBAYrizF3e+P5peka4aLCOgMhYsJBlePThMZN7wja99EGPwXQL4IQ8wKBgB8Nis1lQK6Z30GCp9u4dYleGfEP71Lwqvk/eJb89/uz0fjF9CTpJMULFc+nA5u4yHP3LFnRg3zCU6aEwfwUyk4GH9lWGV/qIAisQtgrCEraVe4qxz0DVE59C7qjO26IhU2U66TEzPAqvQ3zqey+woDn/cz/JMWK1vpcSk+TKn3K');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('a9ca0d0e-894b-45fb-a385-5dfb60a723bd', '2dd71feb-33e7-4e7f-9072-bcc67a541f35', 'certificate', 'MIICmzCCAYMCBgFXt/Tg9TANBgkqhkiG9w0BAQsFADARMQ8wDQYDVQQDDAZtYXN0ZXIwHhcNMTYxMDEyMDgxMjQxWhcNMjYxMDEyMDgxNDIxWjARMQ8wDQYDVQQDDAZtYXN0ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCJTng5egJsfLQvSAefXJqxy1ycodFTWkcUgmda9ojusKUnJ16310MlqJhc7Ewqx6IGbd5jOd83dw/JTy51iZGcy4qOKhxnvstPYgS20CNdvoaBrPHuWiuIUdHLQg4l5fgrFeEA9abGpreaQU18sES8WpVoGBQMdDrRyac+81Idi50FNb0rzSzye+Y/amyjsdPBYnX5dq2PUTL+BOYHcJeXKoF6AZYL1N64SsRiliF2H7XVNVZqyAwFnJQK0vc1E9oG6Fo+DUulbyVYaTTmdL5gzp29OTcymm/7PZHKASnHI7T2hPdvgb5l/CK3VJOqfQC8NMbMg12gpw20VJxXSPxPAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAC54wFHL8tmrksq4OzatzNUM+R+3Hu/VXX3T44dwg0EvXzGW45sME+gKCuleU1PabIrr6oFm0bBMTdxgE2hbLWpYbU3OcsjArpCeCsOlxrAkqhVQN161J+tp77JkDMgArFdwe3wh5bhvLaOZSt6Fsq+oo16CXG1obe1feyaK3+sU3YuDUIHE01UYtvwtfDsYBC+VDyTdNDbB15WcdRoGljJY/JiT0JHdmAfq8qdGDuxGocIV0lSB8bO5JwF/WCmKqMrnh5j1NfGcE1g26Hbz2RmDs17X0K10Okzs/qz1YZqDjPVYiU//VFQQro71/D35dPOJv8mQMjhjNaXScL44h7w=');

INSERT INTO public.component (ID, REALM_ID, PARENT_ID, NAME, PROVIDER_ID, PROVIDER_TYPE) VALUES ('b050d62d-aca1-48fd-9798-8f6b28104fdf', 'Migration', 'Migration', 'rsa', 'rsa', 'org.keycloak.keys.KeyProvider');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('0a6f971d-ceaa-4268-980f-3c307a26c49a', 'b050d62d-aca1-48fd-9798-8f6b28104fdf', 'priority', '100');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('31fdf846-ad9d-4861-aa56-d58e0d869618', 'b050d62d-aca1-48fd-9798-8f6b28104fdf', 'privateKey', 'MIIEpAIBAAKCAQEApt6gCllWkVTZ7fy/oRIx6Bxjt9x3eKKyKGFXvN4iaafrNqpYU9lcqPngWJ9DyXGqUf8RpjPaQWiLWLxjw3xGBqLk2E1/Frb9e/dy8rj//fHGq6bujN1iguzyFwxPGT5Asd7jflRI3qU04M8JE52PArqPhGL2Fn+FiSK5SWRIGm+hVL7Ck/E/tVxM25sFG1/UTQqvrROm4q76TmP8FsyZaTLVf7cCwW2QPIX0N5HTVb3QbBb5KIsk4kKmk/g7uUxS9r42tu533LISzRr5CTyWZAL2XFRuF2RrKdE8gwqkEubw6sDmB2mE0EoPdY1DUhBQgVP/5rwJrCtTsUBR2xdEYQIDAQABAoIBAFbbsNBSOlZBpYJUOmcb8nBQPrOYhXN8tGGCccn0klMOvcdhmcJjdPDbyCQ5Gm7DxJUTwNsTSHsdcNMKlJ9Pk5+msJnKlOl87KrXXbTsCQvlCrWUmb0nCzz9GvJWTOHl3oT3cND0DE4gDksqWR4luCgCdevCGzgQvrBoK6wBD+r578uEW3iw10hnJ0+wnGiw8IvPzE1a9xbY4HD8/QrYdaLxuLb/aC1PDuzrz0cOjnvPkrws5JrbUSnbFygJiOv1z4l2Q00uGIxlHtXdwQBnTZZjVi4vOec2BYSHffgwDYEZIglw1mnrV7y0N1nnPbtJK/cegIkXoBQHXm8Q99TrWMUCgYEA9au86qcwrXZZg5H4BpR5cpy0MSkcKDbA1aRL1cAyTCqJxsczlAtLhFADF+NhnlXj4y7gwDEYWrz064nF73I+ZGicvCiyOy+tCTugTyTGS+XR948ElDMS6PCUUXsotS3dKa0b3c9wd2mxeddTjq/ArfgEVZJ6fE1KtjLt9dtfA+8CgYEAreK3JsvjR5b/Xct28TghYUU7Qnasombb/shqqy8FOMjYUr5OUm/OjNIgoCqhOlE8oQDJ4dOZofNSa7tL+oM8Gmbal+E3fRzxnx/9/EC4QV6sVaPLTIyk7EPfKTcZuzH7+BNZtAziTxJw9d6YJQRbkpg92EZIEoR8iDj2Xs5xrK8CgYEAwMVWwwYX8zT3vn7ukTM2LRH7bsvkVUXJgJqgCwT6Mrv6SmkK9vL5+cPS+Y6pjdW1sRGauBSOGL1Grf/4ug/6F03jFt4UJM8fRyxreU7Q7sNSQ6AMpsGA6BnHODycz7ZCYa59PErG5FyiL4of/cm5Nolz1TXQOPNpWZiTEqVlZC8CgYA4YPbjVF4nuxSnU64H/hwMjsbtAM9uhI016cN0J3W4+J3zDhMU9X1x+Tts0wWdg/N1fGz4lIQOl3cUyRCUc/KL2OdtMS+tmDHbVyMho9ZaE5kq10W2Vy+uDz+O/HeSU12QDK4cC8Vgv+jyPy7zaZtLR6NduUPrBRvfiyCOkr8WrwKBgQCY0h4RCdNFhr0KKLLmJipAtV8wBCGcg1jY1KoWKQswbcykfBKwHbF6EooVqkRW0ITjWB7ZZCf8TnSUxe0NXCUAkVBrhzS4DScgtoSZYOOUaSHgOxpfwgnQ3oYotKi98Yg3IsaLs1j4RuPG5Sp1z6o+ELP1uvr8azyn9YlLa+523Q==');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('054525d4-3dfb-4e89-a880-f02db5589247', 'b050d62d-aca1-48fd-9798-8f6b28104fdf', 'certificate', 'MIICoTCCAYkCBgFXt/t9TjANBgkqhkiG9w0BAQsFADAUMRIwEAYDVQQDDAlNaWdyYXRpb24wHhcNMTYxMDEyMDgxOTU0WhcNMjYxMDEyMDgyMTM0WjAUMRIwEAYDVQQDDAlNaWdyYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCm3qAKWVaRVNnt/L+hEjHoHGO33Hd4orIoYVe83iJpp+s2qlhT2Vyo+eBYn0PJcapR/xGmM9pBaItYvGPDfEYGouTYTX8Wtv1793LyuP/98carpu6M3WKC7PIXDE8ZPkCx3uN+VEjepTTgzwkTnY8Cuo+EYvYWf4WJIrlJZEgab6FUvsKT8T+1XEzbmwUbX9RNCq+tE6birvpOY/wWzJlpMtV/twLBbZA8hfQ3kdNVvdBsFvkoiyTiQqaT+Du5TFL2vja27nfcshLNGvkJPJZkAvZcVG4XZGsp0TyDCqQS5vDqwOYHaYTQSg91jUNSEFCBU//mvAmsK1OxQFHbF0RhAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAFtPdVUB65dAP6v2wu8idPkkqRaP5gmcOuOt2+8/slx7RvO/FFwzFvAqroqmpaKJ53daewZwIG4Wzu4lziqYnD3F3YoqxqUY8ID58SLm9a6XF6aYka7TxXJnZgmy7v1ZWcbbTinvUC7S1m23imT7779cWj5NkkXSM/R+RWB8ZAQCpy9pg7iElAMTlqAp31pCntNG3l1O13A6t5eN3Af474T0FjVaXIEG/PLcRmF/5kTwmkYy5Av1v2vmyLBYXKNUrWwjeTGEEX0+j9AkcF79D1GpdKZpvuC0wxOrOgHLiR9DpGucMJajx+RA8zbAAj5C1A5JfkKBZPh2jMQ06c2eAAM=');

INSERT INTO public.component (ID, REALM_ID, PARENT_ID, NAME, PROVIDER_ID, PROVIDER_TYPE) VALUES ('4c4a3b0d-f005-4aff-8e0f-a6ce01f07b26', 'Migration2', 'Migration2', 'rsa', 'rsa', 'org.keycloak.keys.KeyProvider');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('b35a3fc8-3ab7-4be5-a24a-d183e05c39e0', '4c4a3b0d-f005-4aff-8e0f-a6ce01f07b26', 'priority', '100');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('3c557103-88f8-4968-9af1-d487611b2fc6', '4c4a3b0d-f005-4aff-8e0f-a6ce01f07b26', 'privateKey', 'MIIEowIBAAKCAQEAgzWQuDVTEV0It1322wbNGKc9SSxG9rayxRPbG7YSj4cMP6BO4eblRoUw5ebKCng+OD5FhVIlBnkzoGOCnL/VXaQnEQbqlNwO/N5Ca6/4Mc/MedX8LamlYbo+varVQAJQTZSMp9+NeQZZbSQ3L9EYhsCUdPANwVqYn/CM37FpNZDYfBDxEtaxwP6suuVfUJcupx+YayUbIQ2ZP/FgTE1b/3C3J7nCAhDYlJTag84FOkVhPL2xI9T2XozyHVVwSsPTQDPK+HrTTnE9UqBsglz3ASXElixSs1WKef3iTFiU77p8pjTcxfm3xaE9eLD3tK805KQForBZ7pYSbgp8bY9F7wIDAQABAoIBACH3jf2CIH0QPp9pvew5uIK3WNBGnCBmb6VBXKmx2uA5L9yQ3ZrxsU0uUdhShN9s/X6F8G1xNJCWc90Dpd56cvwI8OwhhD0BMwgXac6DAZezmdW4pc4UavH/yxpCzW4Cq1NKL5eN8gvwrtnoVDkWwmiwFj6nnof9siFFntKSFRB+isvzj+X4wDb0Qc39eeyRdcXGxEwfgVDWIDKCdvW942aEl23WL8LBVshRj/PFu9m7htaoLMk3r27yaFZmzPWbAG/gojCA9EhndpmPrUteReboYcDWc6l3zgdGqxHVyR+JHWdeRMnsdouPoa+2C6nY4THzgkp+NEOsuxc8msTssWECgYEA7cl/SZJrCXIA2Q58mRis5W3F9ZsVx1O+yHpqrXX6a6+MPZ/ERTGY8zU8QINCPmJOGt5APeq9eZNtpaDrGb3KD8Y341LKjkF8uVMg8HJUttHrRZtHm0M+8a7Yf8oIynOkCUaUvnxEerpNPF3TKySfCer1vd9z+GUE3KTj12gAAscCgYEAjUJNJwp5oIbvNZEzFsNJV3MK1xFOxR1/zxoqXKVNVqtz4aOEaqnDd/t7XM+pkW/FSp8V+mZC1+vl4X4mBlTYWxuSMLifglJWlDflgOfPvQNYbDDg94mBleFQ/J7Y4ArEBTdu7QEcaPPwAXocusoeEG+yQpon+CCfkDMUkWIIe5kCgYEAuJT2euzuq7lUUSm+rLUL2VjaFypYwI8QhN0KHDZ9usPdkCSKHdA/U2OartV1QanbyV2G7sleZZZ8wdplRWkfBhmvXoXw+HZ7U/zkj+GgQv42rKS59BtCLCe2pZP2OPmFdzHT2v3pxn8B339Roabe0bsTIV3ozwPTv1c8CgUQJRcCgYBflOJRrXPZHBSWYXZ5S5C/3HcUSYDMPgayYxkQ8UUghQj3P8akydQaxo6VoWoyn7eWo4iikzldkyBMcShXlmeDVmeYEgTUkNRGnH/ttm1Jjw7wvi4rMN7/RKOhG/bRulci1Hx5YAwSNCVNSoxQE9097+ZlzJuI+MIfN4EOUpA82QKBgBdxizw7x2v4g8s2maBcuA1YhncIgPQFnAWHzI7kn5dNHImHRlcM56mEW82u3kZJDVmxM6eNwbI9L+tqPcWwPmI3/NJB970kmVSGWIE7B2AfINkCyAe2fGZaUUxbmNi/01BPIUdRHHxYQsKEdSozi5bET0lLmVnOSBU3qPq9yJZx');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('5e90f479-bef6-48e5-a734-5f5a43d72501', '4c4a3b0d-f005-4aff-8e0f-a6ce01f07b26', 'certificate', 'MIICozCCAYsCBgFZkvmqVDANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDDApNaWdyYXRpb24yMB4XDTE3MDExMjEzNTczMloXDTI3MDExMjEzNTkxMlowFTETMBEGA1UEAwwKTWlncmF0aW9uMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAIM1kLg1UxFdCLdd9tsGzRinPUksRva2ssUT2xu2Eo+HDD+gTuHm5UaFMOXmygp4Pjg+RYVSJQZ5M6Bjgpy/1V2kJxEG6pTcDvzeQmuv+DHPzHnV/C2ppWG6Pr2q1UACUE2UjKffjXkGWW0kNy/RGIbAlHTwDcFamJ/wjN+xaTWQ2HwQ8RLWscD+rLrlX1CXLqcfmGslGyENmT/xYExNW/9wtye5wgIQ2JSU2oPOBTpFYTy9sSPU9l6M8h1VcErD00Azyvh6005xPVKgbIJc9wElxJYsUrNVinn94kxYlO+6fKY03MX5t8WhPXiw97SvNOSkBaKwWe6WEm4KfG2PRe8CAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAQh8J7vFKuj3GN8LBM1FkQopMJZBCc07ZtgWGMx2qEiQKaIgevUdwDm6hjbij06b4oZHWxtC6A8CnVD6R2Uf8+gk0j26xnOJkMNWGw0jpYpKIIpdGHT/lcvnS8ao/c+DZr8CNXZNWeVaDdOv/IDi8+B9n9qwgsGQDHCZ5VT20yBPaJTNUyqVefAtL680yIGz46bI+U7Iipz+1FlFjvDwjSKhOhLPtpD5SP5/AVDbYtD/UPh0yLHSva+/XanGQjhveKVdApoViDgVcdAlj3WO1+L4hVPHfasVLDlhSuDLaFTrPH6Yepv5CxvMpdPOJjAJI4EqMWWxslAjFEV78ya7gKw==');

ALTER TABLE public.REALM DROP COLUMN CODE_SECRET;

ALTER TABLE public.REALM DROP COLUMN PRIVATE_KEY;

ALTER TABLE public.REALM DROP COLUMN PUBLIC_KEY;

ALTER TABLE public.REALM DROP COLUMN CERTIFICATE;

ALTER TABLE public.USER_CONSENT ADD CREATED_DATE BIGINT;

ALTER TABLE public.USER_CONSENT ADD LAST_UPDATED_DATE BIGINT;

INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('2.3.0', 'bburke@redhat.com', 'META-INF/jpa-changelog-2.3.0.xml', NOW(), 31, '7:d6e6f3bc57a0c5586737d1351725d4d4', 'createTable, addPrimaryKey, dropDefaultValue, dropColumn, addColumn (x2), customChange, dropColumn (x4), addColumn', '', 'EXECUTED', NULL, NULL, '3.4.1');

-- Changeset META-INF/jpa-changelog-2.4.0.xml::2.4.0::bburke@redhat.com
INSERT INTO public.component (ID, REALM_ID, PARENT_ID, NAME, PROVIDER_ID, PROVIDER_TYPE) VALUES ('4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'Migration2', 'Migration2', 'ldap-provider', 'ldap', 'org.keycloak.storage.UserStorageProvider');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('f7d784be-5c5e-4c9b-b45d-f2b32702f671', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'priority', '2');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('4cd6c7f3-747b-407d-831a-a6d9e3b422ad', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'fullSyncPeriod', '-1');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('24afd99b-5ba3-4d2d-86d6-640ce2ab35a6', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'changedSyncPeriod', '-1');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('c716ded1-d683-4944-a141-956fc3509109', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'lastSync', '0');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('c926d722-7bb9-4b0b-96ef-2fd227386cff', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'allowKerberosAuthentication', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('e6a2fd0e-1e77-4a40-b495-7bd77e61d5ef', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'authType', 'none');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('a19216c2-091b-459a-b3f9-c760654330a4', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'batchSizeForSync', '1001');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('1e002409-7856-4700-8267-49c6bf948883', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'connectionPooling', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('07a2679b-814a-4f20-bca5-cc1c7aff4529', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'connectionUrl', 'http://localhost');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('1bbd56a4-c61b-4298-a7fb-33aeb18a78cd', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'debug', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('7ad08b67-94b1-4d97-9504-4b77e5065b53', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'editMode', 'READ_ONLY');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('cb867411-b77c-4e8a-9d21-1f13f7598e74', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'kerberosRealm', 'realm');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('2d3acb9a-f3b7-471d-8559-851b956061f4', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'keyTab', 'keytab');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('805450bf-7f71-4093-948e-b0b11f74d031', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'pagination', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('b4fa76c0-2daf-42c3-bd46-491a45c6f176', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'rdnLDAPAttribute', 'uid');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('97361a11-b3eb-499e-9b9e-b4580663ec2e', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'searchScope', '1');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('2729ce77-675f-41e8-85f9-d3bbf16ccd9c', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'serverPrincipal', 'principal');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('10f3a09e-5e13-4c6a-b748-2276cd2407ce', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'syncRegistrations', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('62a4cab0-d434-4901-bc1a-308706812653', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'useKerberosForPasswordAuthentication', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('9674acfa-69b3-4b91-94ce-053cca6790ef', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'userAccountControlsAfterPasswordUpdate', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('b33bb9c4-ae4e-47ef-96c5-8820cd707919', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'usernameLDAPAttribute', 'uid');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('0ea7a3f2-578f-468c-bce5-4812dc91ea0b', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'userObjectClasses', 'inetOrgPerson, organizationalPerson');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('4ef1798a-ea67-4412-a36a-e337ec026f21', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'usersDn', 'dn');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('26bc0b5b-4331-4498-911c-8ab139de83d7', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'useTruststoreSpi', 'ldapsOnly');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('a3ca8b6b-1899-4b16-b599-9ae2acaf3e5b', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'uuidLDAPAttribute', 'nsuniqueid');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('378b4bdf-a536-4217-89e9-4376508192ba', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'vendor', 'rhds');

INSERT INTO public.component (ID, REALM_ID, PARENT_ID, NAME, PROVIDER_ID, PROVIDER_TYPE) VALUES ('1233a86b-652b-4f2a-b307-90bfd3106ad2', 'Migration2', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'creation date', 'user-attribute-ldap-mapper', 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('b027dbd6-1eac-47fe-bf0f-31f1eca2943d', '1233a86b-652b-4f2a-b307-90bfd3106ad2', 'always.read.value.from.ldap', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('46fcb16d-e3b9-453c-95a0-1bd101f7d76c', '1233a86b-652b-4f2a-b307-90bfd3106ad2', 'is.mandatory.in.ldap', 'false');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('c018f293-0f58-47da-b668-88a4d424aa04', '1233a86b-652b-4f2a-b307-90bfd3106ad2', 'ldap.attribute', 'createTimestamp');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('c82f0b64-72fe-4bf7-89ca-a88e2202dac6', '1233a86b-652b-4f2a-b307-90bfd3106ad2', 'read.only', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('cc743a5e-70e2-49f5-a563-79497d70595c', '1233a86b-652b-4f2a-b307-90bfd3106ad2', 'user.model.attribute', 'createTimestamp');

DELETE FROM public.user_federation_mapper_config WHERE USER_FEDERATION_MAPPER_ID='1233a86b-652b-4f2a-b307-90bfd3106ad2';

DELETE FROM public.user_federation_mapper WHERE ID='1233a86b-652b-4f2a-b307-90bfd3106ad2';

INSERT INTO public.component (ID, REALM_ID, PARENT_ID, NAME, PROVIDER_ID, PROVIDER_TYPE) VALUES ('1c74823a-41d6-49f8-b07e-7d33da5e2194', 'Migration2', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'first name', 'user-attribute-ldap-mapper', 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('fc46d313-f5a6-47d3-9bac-aedd6d118209', '1c74823a-41d6-49f8-b07e-7d33da5e2194', 'always.read.value.from.ldap', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('9228f25f-5f09-4e22-8397-c6779cbec7a8', '1c74823a-41d6-49f8-b07e-7d33da5e2194', 'is.mandatory.in.ldap', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('a105bc5c-85b9-4ed8-a361-ce0d1be57a3e', '1c74823a-41d6-49f8-b07e-7d33da5e2194', 'ldap.attribute', 'cn');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('40441874-3639-4e0a-bbad-cbdc72f068ee', '1c74823a-41d6-49f8-b07e-7d33da5e2194', 'read.only', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('9d4991f3-65b0-47f2-be55-ced824b15e0b', '1c74823a-41d6-49f8-b07e-7d33da5e2194', 'user.model.attribute', 'firstName');

DELETE FROM public.user_federation_mapper_config WHERE USER_FEDERATION_MAPPER_ID='1c74823a-41d6-49f8-b07e-7d33da5e2194';

DELETE FROM public.user_federation_mapper WHERE ID='1c74823a-41d6-49f8-b07e-7d33da5e2194';

INSERT INTO public.component (ID, REALM_ID, PARENT_ID, NAME, PROVIDER_ID, PROVIDER_TYPE) VALUES ('18cc83a5-f52f-44d6-8d9f-63352e5729db', 'Migration2', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'email', 'user-attribute-ldap-mapper', 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('1d84c61c-54c1-4cf3-ba1d-616bd6e2a76f', '18cc83a5-f52f-44d6-8d9f-63352e5729db', 'always.read.value.from.ldap', 'false');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('92d29208-bcd3-4b72-b668-358e753495d9', '18cc83a5-f52f-44d6-8d9f-63352e5729db', 'is.mandatory.in.ldap', 'false');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('f72340ac-1af6-4dec-b172-d77e9e896b0b', '18cc83a5-f52f-44d6-8d9f-63352e5729db', 'ldap.attribute', 'mail');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('1047df46-e554-4cdb-be6d-d3ad9e693eda', '18cc83a5-f52f-44d6-8d9f-63352e5729db', 'read.only', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('630bc2a9-5533-4dcd-887c-b2a415297f83', '18cc83a5-f52f-44d6-8d9f-63352e5729db', 'user.model.attribute', 'email');

DELETE FROM public.user_federation_mapper_config WHERE USER_FEDERATION_MAPPER_ID='18cc83a5-f52f-44d6-8d9f-63352e5729db';

DELETE FROM public.user_federation_mapper WHERE ID='18cc83a5-f52f-44d6-8d9f-63352e5729db';

INSERT INTO public.component (ID, REALM_ID, PARENT_ID, NAME, PROVIDER_ID, PROVIDER_TYPE) VALUES ('73a80de2-ee0c-4394-90b3-0bd96bc4fa81', 'Migration2', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'last name', 'user-attribute-ldap-mapper', 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('360a1a7d-7a20-49dd-b796-5f13788ff96d', '73a80de2-ee0c-4394-90b3-0bd96bc4fa81', 'always.read.value.from.ldap', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('64dc4a98-1ad5-4545-b94c-3f33db82d509', '73a80de2-ee0c-4394-90b3-0bd96bc4fa81', 'is.mandatory.in.ldap', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('cf573557-ac30-47f3-88bf-da3ad0170afb', '73a80de2-ee0c-4394-90b3-0bd96bc4fa81', 'ldap.attribute', 'sn');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('244aa163-5712-46d3-ab4b-7ac350de942f', '73a80de2-ee0c-4394-90b3-0bd96bc4fa81', 'read.only', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('a6929d77-885a-4a96-bd98-e9d3a0281976', '73a80de2-ee0c-4394-90b3-0bd96bc4fa81', 'user.model.attribute', 'lastName');

DELETE FROM public.user_federation_mapper_config WHERE USER_FEDERATION_MAPPER_ID='73a80de2-ee0c-4394-90b3-0bd96bc4fa81';

DELETE FROM public.user_federation_mapper WHERE ID='73a80de2-ee0c-4394-90b3-0bd96bc4fa81';

INSERT INTO public.component (ID, REALM_ID, PARENT_ID, NAME, PROVIDER_ID, PROVIDER_TYPE) VALUES ('c5b20dd5-4f7c-422d-adf3-6bd75ae89b65', 'Migration2', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'username', 'user-attribute-ldap-mapper', 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('bdedd391-fc1b-4dc6-8ae3-5fe25a5a1cc9', 'c5b20dd5-4f7c-422d-adf3-6bd75ae89b65', 'always.read.value.from.ldap', 'false');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('16922aa8-f5c8-46f4-aa7b-81d5b4f134b7', 'c5b20dd5-4f7c-422d-adf3-6bd75ae89b65', 'is.mandatory.in.ldap', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('7ce9a644-96f2-4c0c-9244-e285d4038ec8', 'c5b20dd5-4f7c-422d-adf3-6bd75ae89b65', 'ldap.attribute', 'uid');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('abfa3768-d695-47c1-a18f-2011a7d516c3', 'c5b20dd5-4f7c-422d-adf3-6bd75ae89b65', 'read.only', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('1f6d67c7-442e-43d4-9dd6-dff4c883837d', 'c5b20dd5-4f7c-422d-adf3-6bd75ae89b65', 'user.model.attribute', 'username');

DELETE FROM public.user_federation_mapper_config WHERE USER_FEDERATION_MAPPER_ID='c5b20dd5-4f7c-422d-adf3-6bd75ae89b65';

DELETE FROM public.user_federation_mapper WHERE ID='c5b20dd5-4f7c-422d-adf3-6bd75ae89b65';

INSERT INTO public.component (ID, REALM_ID, PARENT_ID, NAME, PROVIDER_ID, PROVIDER_TYPE) VALUES ('d4e4ba3a-716b-4173-9490-06a0e19a82d0', 'Migration2', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'modify date', 'user-attribute-ldap-mapper', 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('0e5a6719-6efc-4c70-b922-19e27636e360', 'd4e4ba3a-716b-4173-9490-06a0e19a82d0', 'always.read.value.from.ldap', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('aa64ce56-8f17-41aa-836c-7cc6a83e6c06', 'd4e4ba3a-716b-4173-9490-06a0e19a82d0', 'is.mandatory.in.ldap', 'false');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('eaa16e2c-8d7d-48b6-a687-b6a24177a9d3', 'd4e4ba3a-716b-4173-9490-06a0e19a82d0', 'ldap.attribute', 'modifyTimestamp');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('30687300-5a8d-418f-a484-c142bdc37c17', 'd4e4ba3a-716b-4173-9490-06a0e19a82d0', 'read.only', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('fa2ac6f7-31f4-4da4-91d4-9f8fdc80ca6a', 'd4e4ba3a-716b-4173-9490-06a0e19a82d0', 'user.model.attribute', 'modifyTimestamp');

DELETE FROM public.user_federation_mapper_config WHERE USER_FEDERATION_MAPPER_ID='d4e4ba3a-716b-4173-9490-06a0e19a82d0';

DELETE FROM public.user_federation_mapper WHERE ID='d4e4ba3a-716b-4173-9490-06a0e19a82d0';

DELETE FROM public.user_federation_config WHERE USER_FEDERATION_PROVIDER_ID='4dd39136-ae1f-4cb7-b769-ce97e1865aa6';

DELETE FROM public.user_federation_provider WHERE ID='4dd39136-ae1f-4cb7-b769-ce97e1865aa6';

INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('2.4.0', 'bburke@redhat.com', 'META-INF/jpa-changelog-2.4.0.xml', NOW(), 32, '7:454d604fbd755d9df3fd9c6329043aa5', 'customChange', '', 'EXECUTED', NULL, NULL, '3.4.1');

-- Changeset META-INF/jpa-changelog-2.5.0.xml::2.5.0::bburke@redhat.com
INSERT INTO public.component (ID, REALM_ID, PARENT_ID, NAME, PROVIDER_ID, PROVIDER_TYPE) VALUES ('4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'Migration2', 'Migration2', 'ldap-provider', 'ldap', 'org.keycloak.storage.UserStorageProvider');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('a10d2944-b104-4541-971a-33fba375df05', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'priority', '2');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('6ea98bc8-3bce-4f67-a621-e815d65e9e97', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'fullSyncPeriod', '-1');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('529378e0-1379-4bb6-b35e-207080addbf1', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'changedSyncPeriod', '-1');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('88e9e53e-0c6b-4b63-be8e-c674fce24e2e', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'lastSync', '0');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('0c1363ef-95a2-4f18-b69a-9a49caa8d7ec', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'allowKerberosAuthentication', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('043a6547-3955-4b1f-8f33-6f9f59bb35d6', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'authType', 'none');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('76431cab-ee8b-4c25-bf13-702f07651801', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'batchSizeForSync', '1001');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('60de697d-54d5-4100-815e-7c2a0a7323d9', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'connectionPooling', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('0effde28-5369-4f66-9f51-dad0302e83f5', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'connectionUrl', 'http://localhost');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('ab8651ae-e622-4825-925b-ed22a8b0b3ba', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'debug', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('3c400117-9ff3-4279-b586-3cef949849a4', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'editMode', 'READ_ONLY');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('b710e083-0921-44c0-a033-5e9ef86b7334', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'kerberosRealm', 'realm');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('df66a5ce-5d9b-4cff-9c69-791c9e5d13c6', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'keyTab', 'keytab');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('ae080727-3d53-49d5-978b-d8d7d3b08bb1', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'pagination', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('25379caf-5413-4b97-b854-afcdabffff3d', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'rdnLDAPAttribute', 'uid');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('666e134c-de74-4907-a6dd-4f687d5999fd', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'searchScope', '1');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('266bfeb9-228d-4175-8be0-749ed66f7e3b', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'serverPrincipal', 'principal');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('40063500-e2d8-4ab3-9872-f090b565991b', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'syncRegistrations', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('c95ca35f-a517-49ee-aaf9-82a5696c6a81', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'useKerberosForPasswordAuthentication', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('fdbcbd82-0e97-4c22-9216-48a40c67176f', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'userAccountControlsAfterPasswordUpdate', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('7d43a4d7-1e41-41ea-81f6-753ad00d82a0', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'usernameLDAPAttribute', 'uid');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('dcf8bede-b9eb-46b0-94d4-456673bf7651', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'userObjectClasses', 'inetOrgPerson, organizationalPerson');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('8767937d-43e0-4e2a-bebd-4a74f3ecf977', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'usersDn', 'dn');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('ff542f78-2db1-450e-b066-37cb505306cb', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'useTruststoreSpi', 'ldapsOnly');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('cbfb76a8-e6bd-4124-b2fd-fffba965f82b', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'uuidLDAPAttribute', 'nsuniqueid');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('979a53e1-4822-4fcb-a673-9ded58b925cf', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'vendor', 'rhds');

DELETE FROM public.user_federation_config WHERE USER_FEDERATION_PROVIDER_ID='4dd39136-ae1f-4cb7-b769-ce97e1865aa6';

DELETE FROM public.user_federation_provider WHERE ID='4dd39136-ae1f-4cb7-b769-ce97e1865aa6';

INSERT INTO public.component (ID, REALM_ID, PARENT_ID, NAME, PROVIDER_ID, PROVIDER_TYPE) VALUES ('03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'Migration2', 'Migration2', 'kerberos-provider', 'kerberos', 'org.keycloak.storage.UserStorageProvider');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('66088068-788d-4fec-a7f5-c9a8cbced9d0', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'priority', '3');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('c5e1867c-fe13-413f-a949-1ccd6f131b4d', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'fullSyncPeriod', '0');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('5629c2d3-eda3-4d84-8d4e-a30d1170ac9f', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'changedSyncPeriod', '0');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('bff6df63-6020-4938-b441-b715530b51e0', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'lastSync', '0');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('b1458d1a-5247-401b-b9de-14e45a7d80b3', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'allowKerberosAuthentication', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('7e28bd92-d3b6-4c66-9fd5-6304eb005d31', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'allowPasswordAuthentication', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('36e40475-f43e-4f7c-b6c3-0ae5ea70391a', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'debug', 'true');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('e76bb664-a19e-4085-9746-4ecb5674d2fd', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'editMode', 'READ_ONLY');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('abd2f2e7-1232-44aa-8f58-310cb1255003', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'kerberosRealm', 'realm');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('d9ffdf2c-7d0f-48d3-9859-ae4980fe6ddc', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'keyTab', 'keytab');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('5a3579ce-205d-49d2-a3ae-5dc78ffb4b7b', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'serverPrincipal', 'principal');

INSERT INTO public.component_config (ID, COMPONENT_ID, NAME, VALUE) VALUES ('4b375539-18ca-4a3d-8496-40c467c0773a', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'updateProfileFirstLogin', 'true');

DELETE FROM public.user_federation_config WHERE USER_FEDERATION_PROVIDER_ID='03b669fa-f86f-42fb-b4a4-88315b3ebeb6';

DELETE FROM public.user_federation_provider WHERE ID='03b669fa-f86f-42fb-b4a4-88315b3ebeb6';

ALTER TABLE public.OFFLINE_USER_SESSION ALTER COLUMN USER_ID TYPE VARCHAR(255) USING (USER_ID::VARCHAR(255));

INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('2.5.0', 'bburke@redhat.com', 'META-INF/jpa-changelog-2.5.0.xml', NOW(), 33, '7:57e98a3077e29caf562f7dbf80c72600', 'customChange, modifyDataType', '', 'EXECUTED', NULL, NULL, '3.4.1');

-- Changeset META-INF/jpa-changelog-2.5.0.xml::2.5.0-unicode-oracle::hmlnarik@redhat.com
INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('2.5.0-unicode-oracle', 'hmlnarik@redhat.com', 'META-INF/jpa-changelog-2.5.0.xml', NOW(), 34, '7:e4c7e8f2256210aee71ddc42f538b57a', 'modifyDataType (x13), addColumn, sql, dropColumn, renameColumn, modifyDataType (x2)', '', 'MARK_RAN', NULL, NULL, '3.4.1');

-- Changeset META-INF/jpa-changelog-2.5.0.xml::2.5.0-unicode-other-dbs::hmlnarik@redhat.com
ALTER TABLE public.AUTHENTICATION_FLOW ALTER COLUMN DESCRIPTION TYPE VARCHAR(255) USING (DESCRIPTION::VARCHAR(255));

ALTER TABLE public.CLIENT_TEMPLATE ALTER COLUMN DESCRIPTION TYPE VARCHAR(255) USING (DESCRIPTION::VARCHAR(255));

ALTER TABLE public.RESOURCE_SERVER_POLICY ALTER COLUMN DESCRIPTION TYPE VARCHAR(255) USING (DESCRIPTION::VARCHAR(255));

ALTER TABLE public.CLIENT ALTER COLUMN DESCRIPTION TYPE VARCHAR(255) USING (DESCRIPTION::VARCHAR(255));

ALTER TABLE public.CLIENT ALTER COLUMN NAME TYPE VARCHAR(255) USING (NAME::VARCHAR(255));

ALTER TABLE public.USER_ENTITY DROP CONSTRAINT UK_RU8TT6T700S9V50BU18WS5HA6;

ALTER TABLE public.USER_ENTITY ALTER COLUMN FIRST_NAME TYPE VARCHAR(255) USING (FIRST_NAME::VARCHAR(255));

ALTER TABLE public.USER_ENTITY ALTER COLUMN LAST_NAME TYPE VARCHAR(255) USING (LAST_NAME::VARCHAR(255));

ALTER TABLE public.USER_ENTITY ALTER COLUMN USERNAME TYPE VARCHAR(255) USING (USERNAME::VARCHAR(255));

ALTER TABLE public.USER_ENTITY ADD CONSTRAINT UK_RU8TT6T700S9V50BU18WS5HA6 UNIQUE (REALM_ID, USERNAME);

ALTER TABLE public.USERNAME_LOGIN_FAILURE DROP CONSTRAINT CONSTRAINT_17;

ALTER TABLE public.USERNAME_LOGIN_FAILURE ALTER COLUMN USERNAME TYPE VARCHAR(255) USING (USERNAME::VARCHAR(255));

ALTER TABLE public.USERNAME_LOGIN_FAILURE ALTER COLUMN  USERNAME SET NOT NULL;

ALTER TABLE public.USERNAME_LOGIN_FAILURE ADD CONSTRAINT "CONSTRAINT_17-2" PRIMARY KEY (REALM_ID, USERNAME);

ALTER TABLE public.KEYCLOAK_GROUP ALTER COLUMN NAME TYPE VARCHAR(255) USING (NAME::VARCHAR(255));

ALTER TABLE public.USER_ATTRIBUTE ALTER COLUMN VALUE TYPE VARCHAR(255) USING (VALUE::VARCHAR(255));

ALTER TABLE public.GROUP_ATTRIBUTE ALTER COLUMN VALUE TYPE VARCHAR(255) USING (VALUE::VARCHAR(255));

ALTER TABLE public.REALM_ATTRIBUTE ALTER COLUMN VALUE TYPE VARCHAR(255) USING (VALUE::VARCHAR(255));

ALTER TABLE public.COMPONENT_CONFIG ALTER COLUMN VALUE TYPE VARCHAR(4000) USING (VALUE::VARCHAR(4000));

ALTER TABLE public.KEYCLOAK_ROLE DROP CONSTRAINT "UK_J3RWUVD56ONTGSUHOGM184WW2-2";

ALTER TABLE public.KEYCLOAK_ROLE ALTER COLUMN NAME TYPE VARCHAR(255) USING (NAME::VARCHAR(255));

ALTER TABLE public.KEYCLOAK_ROLE ADD CONSTRAINT "UK_J3RWUVD56ONTGSUHOGM184WW2-2" UNIQUE (NAME, CLIENT_REALM_CONSTRAINT);

ALTER TABLE public.KEYCLOAK_ROLE ALTER COLUMN DESCRIPTION TYPE VARCHAR(255) USING (DESCRIPTION::VARCHAR(255));

INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('2.5.0-unicode-other-dbs', 'hmlnarik@redhat.com', 'META-INF/jpa-changelog-2.5.0.xml', NOW(), 35, '7:09a43c97e49bc626460480aa1379b522', 'modifyDataType (x5), dropUniqueConstraint, modifyDataType (x3), addUniqueConstraint, dropPrimaryKey, modifyDataType, addNotNullConstraint, addPrimaryKey, modifyDataType (x5), dropUniqueConstraint, modifyDataType, addUniqueConstraint, modifyDataType', '', 'EXECUTED', NULL, NULL, '3.4.1');

-- Changeset META-INF/jpa-changelog-2.5.0.xml::2.5.0-duplicate-email-support::slawomir@dabek.name
ALTER TABLE public.REALM ADD LOGIN_WITH_EMAIL_ALLOWED BOOLEAN NOT NULL DEFAULT TRUE;

ALTER TABLE public.REALM ADD DUPLICATE_EMAILS_ALLOWED BOOLEAN NOT NULL DEFAULT FALSE;

INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('2.5.0-duplicate-email-support', 'slawomir@dabek.name', 'META-INF/jpa-changelog-2.5.0.xml', NOW(), 36, '7:26bfc7c74fefa9126f2ce702fb775553', 'addColumn', '', 'EXECUTED', NULL, NULL, '3.4.1');

-- Changeset META-INF/jpa-changelog-2.5.0.xml::2.5.0-unique-group-names::hmlnarik@redhat.com
ALTER TABLE public.KEYCLOAK_GROUP ADD CONSTRAINT SIBLING_NAMES UNIQUE (REALM_ID, PARENT_GROUP, NAME);

INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('2.5.0-unique-group-names', 'hmlnarik@redhat.com', 'META-INF/jpa-changelog-2.5.0.xml', NOW(), 37, '7:a161e2ae671a9020fff61e996a207377', 'addUniqueConstraint', '', 'EXECUTED', NULL, NULL, '3.4.1');

-- Changeset META-INF/jpa-changelog-2.5.1.xml::2.5.1::bburke@redhat.com
ALTER TABLE public.FED_USER_CONSENT ADD CREATED_DATE BIGINT;

ALTER TABLE public.FED_USER_CONSENT ADD LAST_UPDATED_DATE BIGINT;

INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('2.5.1', 'bburke@redhat.com', 'META-INF/jpa-changelog-2.5.1.xml', NOW(), 38, '7:37fc1781855ac5388c494f1442b3f717', 'addColumn', '', 'EXECUTED', NULL, NULL, '3.4.1');

-- *********************************************************************
-- * Keycloak database creation script - apply this script to empty DB *
-- *********************************************************************

CREATE TABLE public.databasechangelog_example_en (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED TIMESTAMP WITHOUT TIME ZONE NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255));

-- *********************************************************************

-- *********************************************************************
-- Update Database Script
-- *********************************************************************
-- Change Log: META-INF/example-changelog.xml
-- Ran at: 2/1/17 7:59 AM
-- Against: dballo13@jdbc:edb://db-32.rhev-ci-vms.eng.rdu2.redhat.com:5432/dballo13
-- Liquibase version: 3.4.1
-- *********************************************************************

-- Changeset META-INF/example-changelog.xml::example-1.0::erik.mulder@docdatapayments.com
CREATE TABLE public.EXAMPLE_COMPANY (ID VARCHAR(36) NOT NULL, NAME VARCHAR(255) NOT NULL, REALM_ID VARCHAR(36) NOT NULL);

ALTER TABLE public.EXAMPLE_COMPANY ADD CONSTRAINT PK_COMPANY PRIMARY KEY (ID);

INSERT INTO public.databasechangelog_example_en (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE) VALUES ('example-1.0', 'erik.mulder@docdatapayments.com', 'META-INF/example-changelog.xml', NOW(), 1, '7:4eb040a6f792db674a0fdd7c79db2cc3', 'createTable, addPrimaryKey', '', 'EXECUTED', NULL, NULL, '3.4.1');

