-- *********************************************************************
-- Update Database Script
-- *********************************************************************
-- Change Log: META-INF/jpa-changelog-master.xml
-- Ran at: 2/1/17 8:01 AM
-- Against: dballo19@jdbc:sqlserver://db-25.rhev-ci-vms.eng.rdu2.redhat.com:1433;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustServerCertificate=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;packetSize=8000;multiSubnetFailover=false;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=dballo19;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite;
-- Liquibase version: 3.4.1
-- *********************************************************************

USE [dballo19];
GO

-- Changeset META-INF/db2-jpa-changelog-1.0.0.Final.xml::1.0.0.Final::sthorger@redhat.com
INSERT INTO [dbo].[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', GETDATE(), 20, '7:f061c3934594ee60a9b2343f5100ae4e', 'createTable (x29), addPrimaryKey (x21), addUniqueConstraint (x6), addForeignKeyConstraint (x30)', '', 'MARK_RAN', NULL, NULL, '3.4.1')
GO

-- Changeset META-INF/db2-jpa-changelog-1.2.0.Beta1.xml::1.2.0.Beta1::psilva@redhat.com
INSERT INTO [dbo].[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', GETDATE(), 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')
GO

-- Changeset META-INF/db2-jpa-changelog-1.2.0.CR1.xml::1.2.0.RC1::bburke@redhat.com
INSERT INTO [dbo].[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', GETDATE(), 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')
GO

-- Changeset META-INF/db2-jpa-changelog-1.4.0.xml::1.4.0::bburke@redhat.com
INSERT INTO [dbo].[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', GETDATE(), 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')
GO

-- Changeset META-INF/db2-jpa-changelog-1.8.0.xml::1.8.0::mposolda@redhat.com
INSERT INTO [dbo].[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', GETDATE(), 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')
GO

-- Changeset META-INF/db2-jpa-changelog-1.8.0.xml::1.8.0-2::keycloak
INSERT INTO [dbo].[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', GETDATE(), 25, '7:df8bc21027a4f7cbbb01f6344e89ce07', 'dropDefaultValue, update', '', 'MARK_RAN', NULL, NULL, '3.4.1')
GO

-- Changeset META-INF/db2-jpa-changelog-1.9.1.xml::1.9.1::keycloak
INSERT INTO [dbo].[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', GETDATE(), 26, '7:1437310ed1305a9b93f8848f301726ce', 'modifyDataType (x2)', '', 'MARK_RAN', NULL, NULL, '3.4.1')
GO

-- Changeset META-INF/jpa-changelog-authz-2.0.0.xml::authz-2.0.0::psilva@redhat.com
CREATE TABLE [dbo].[RESOURCE_SERVER] ([ID] [varchar](36) NOT NULL, [CLIENT_ID] [varchar](36) NOT NULL, [ALLOW_RS_REMOTE_MGMT] [bit] CONSTRAINT DF_RESOURCE_SERVER_ALLOW_RS_REMOTE_MGMT DEFAULT 0 NOT NULL, [POLICY_ENFORCE_MODE] [varchar](15) NOT NULL)
GO

ALTER TABLE [dbo].[RESOURCE_SERVER] ADD CONSTRAINT [CONSTRAINT_FARS] PRIMARY KEY ([ID])
GO

ALTER TABLE [dbo].[RESOURCE_SERVER] ADD CONSTRAINT [UK_AU8TT6T700S9V50BU18WS5HA6] UNIQUE ([CLIENT_ID])
GO

CREATE TABLE [dbo].[RESOURCE_SERVER_RESOURCE] ([ID] [varchar](36) NOT NULL, [NAME] [varchar](255) NOT NULL, [URI] [varchar](255) NULL, [TYPE] [varchar](255) NULL, [ICON_URI] [varchar](255) NULL, [OWNER] [varchar](36) NOT NULL, [RESOURCE_SERVER_ID] [varchar](36) NOT NULL)
GO

ALTER TABLE [dbo].[RESOURCE_SERVER_RESOURCE] ADD CONSTRAINT [CONSTRAINT_FARSR] PRIMARY KEY ([ID])
GO

ALTER TABLE [dbo].[RESOURCE_SERVER_RESOURCE] ADD CONSTRAINT [FK_FRSRHO213XCX4WNKOG82SSRFY] FOREIGN KEY ([RESOURCE_SERVER_ID]) REFERENCES [dbo].[RESOURCE_SERVER] ([ID])
GO

ALTER TABLE [dbo].[RESOURCE_SERVER_RESOURCE] ADD CONSTRAINT [UK_FRSR6T700S9V50BU18WS5HA6] UNIQUE ([NAME], [OWNER], [RESOURCE_SERVER_ID])
GO

CREATE TABLE [dbo].[RESOURCE_SERVER_SCOPE] ([ID] [varchar](36) NOT NULL, [NAME] [varchar](255) NOT NULL, [ICON_URI] [varchar](255) NULL, [RESOURCE_SERVER_ID] [varchar](36) NOT NULL)
GO

ALTER TABLE [dbo].[RESOURCE_SERVER_SCOPE] ADD CONSTRAINT [CONSTRAINT_FARSRS] PRIMARY KEY ([ID])
GO

ALTER TABLE [dbo].[RESOURCE_SERVER_SCOPE] ADD CONSTRAINT [FK_FRSRSO213XCX4WNKOG82SSRFY] FOREIGN KEY ([RESOURCE_SERVER_ID]) REFERENCES [dbo].[RESOURCE_SERVER] ([ID])
GO

ALTER TABLE [dbo].[RESOURCE_SERVER_SCOPE] ADD CONSTRAINT [UK_FRSRST700S9V50BU18WS5HA6] UNIQUE ([NAME], [RESOURCE_SERVER_ID])
GO

CREATE TABLE [dbo].[RESOURCE_SERVER_POLICY] ([ID] [varchar](36) NOT NULL, [NAME] [varchar](255) NOT NULL, [DESCRIPTION] [varchar](255) NULL, [TYPE] [varchar](255) NOT NULL, [DECISION_STRATEGY] [varchar](20) NULL, [LOGIC] [varchar](20) NULL, [RESOURCE_SERVER_ID] [varchar](36) NOT NULL)
GO

ALTER TABLE [dbo].[RESOURCE_SERVER_POLICY] ADD CONSTRAINT [CONSTRAINT_FARSRP] PRIMARY KEY ([ID])
GO

ALTER TABLE [dbo].[RESOURCE_SERVER_POLICY] ADD CONSTRAINT [FK_FRSRPO213XCX4WNKOG82SSRFY] FOREIGN KEY ([RESOURCE_SERVER_ID]) REFERENCES [dbo].[RESOURCE_SERVER] ([ID])
GO

ALTER TABLE [dbo].[RESOURCE_SERVER_POLICY] ADD CONSTRAINT [UK_FRSRPT700S9V50BU18WS5HA6] UNIQUE ([NAME], [RESOURCE_SERVER_ID])
GO

CREATE TABLE [dbo].[POLICY_CONFIG] ([POLICY_ID] [varchar](36) NOT NULL, [NAME] [varchar](255) NOT NULL, [VALUE] [varchar](MAX) NULL)
GO

ALTER TABLE [dbo].[POLICY_CONFIG] ADD CONSTRAINT [CONSTRAINT_DPC] PRIMARY KEY ([POLICY_ID], [NAME])
GO

ALTER TABLE [dbo].[POLICY_CONFIG] ADD CONSTRAINT [FKDC34197CF864C4E43] FOREIGN KEY ([POLICY_ID]) REFERENCES [dbo].[RESOURCE_SERVER_POLICY] ([ID])
GO

CREATE TABLE [dbo].[RESOURCE_SCOPE] ([RESOURCE_ID] [varchar](36) NOT NULL, [SCOPE_ID] [varchar](36) NOT NULL)
GO

ALTER TABLE [dbo].[RESOURCE_SCOPE] ADD CONSTRAINT [CONSTRAINT_FARSRSP] PRIMARY KEY ([RESOURCE_ID], [SCOPE_ID])
GO

ALTER TABLE [dbo].[RESOURCE_SCOPE] ADD CONSTRAINT [FK_FRSRPOS13XCX4WNKOG82SSRFY] FOREIGN KEY ([RESOURCE_ID]) REFERENCES [dbo].[RESOURCE_SERVER_RESOURCE] ([ID])
GO

ALTER TABLE [dbo].[RESOURCE_SCOPE] ADD CONSTRAINT [FK_FRSRPS213XCX4WNKOG82SSRFY] FOREIGN KEY ([SCOPE_ID]) REFERENCES [dbo].[RESOURCE_SERVER_SCOPE] ([ID])
GO

CREATE TABLE [dbo].[RESOURCE_POLICY] ([RESOURCE_ID] [varchar](36) NOT NULL, [POLICY_ID] [varchar](36) NOT NULL)
GO

ALTER TABLE [dbo].[RESOURCE_POLICY] ADD CONSTRAINT [CONSTRAINT_FARSRPP] PRIMARY KEY ([RESOURCE_ID], [POLICY_ID])
GO

ALTER TABLE [dbo].[RESOURCE_POLICY] ADD CONSTRAINT [FK_FRSRPOS53XCX4WNKOG82SSRFY] FOREIGN KEY ([RESOURCE_ID]) REFERENCES [dbo].[RESOURCE_SERVER_RESOURCE] ([ID])
GO

ALTER TABLE [dbo].[RESOURCE_POLICY] ADD CONSTRAINT [FK_FRSRPP213XCX4WNKOG82SSRFY] FOREIGN KEY ([POLICY_ID]) REFERENCES [dbo].[RESOURCE_SERVER_POLICY] ([ID])
GO

CREATE TABLE [dbo].[SCOPE_POLICY] ([SCOPE_ID] [varchar](36) NOT NULL, [POLICY_ID] [varchar](36) NOT NULL)
GO

ALTER TABLE [dbo].[SCOPE_POLICY] ADD CONSTRAINT [CONSTRAINT_FARSRSPS] PRIMARY KEY ([SCOPE_ID], [POLICY_ID])
GO

ALTER TABLE [dbo].[SCOPE_POLICY] ADD CONSTRAINT [FK_FRSRPASS3XCX4WNKOG82SSRFY] FOREIGN KEY ([SCOPE_ID]) REFERENCES [dbo].[RESOURCE_SERVER_SCOPE] ([ID])
GO

ALTER TABLE [dbo].[SCOPE_POLICY] ADD CONSTRAINT [FK_FRSRASP13XCX4WNKOG82SSRFY] FOREIGN KEY ([POLICY_ID]) REFERENCES [dbo].[RESOURCE_SERVER_POLICY] ([ID])
GO

CREATE TABLE [dbo].[ASSOCIATED_POLICY] ([POLICY_ID] [varchar](36) NOT NULL, [ASSOCIATED_POLICY_ID] [varchar](36) NOT NULL)
GO

ALTER TABLE [dbo].[ASSOCIATED_POLICY] ADD CONSTRAINT [CONSTRAINT_FARSRPAP] PRIMARY KEY ([POLICY_ID], [ASSOCIATED_POLICY_ID])
GO

ALTER TABLE [dbo].[ASSOCIATED_POLICY] ADD CONSTRAINT [FK_FRSRPAS14XCX4WNKOG82SSRFY] FOREIGN KEY ([POLICY_ID]) REFERENCES [dbo].[RESOURCE_SERVER_POLICY] ([ID])
GO

ALTER TABLE [dbo].[ASSOCIATED_POLICY] ADD CONSTRAINT [FK_FRSR5S213XCX4WNKOG82SSRFY] FOREIGN KEY ([ASSOCIATED_POLICY_ID]) REFERENCES [dbo].[RESOURCE_SERVER_POLICY] ([ID])
GO

INSERT INTO [dbo].[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', GETDATE(), 27, '7:9cc98082921330d8d9266decdd4bd658', 'createTable, addPrimaryKey, addUniqueConstraint, createTable, addPrimaryKey, addForeignKeyConstraint, addUniqueConstraint, createTable, addPrimaryKey, addForeignKeyConstraint, addUniqueConstraint, createTable, addPrimaryKey, addForeignKeyConstrain...', '', 'EXECUTED', NULL, NULL, '3.4.1')
GO

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

INSERT INTO [dbo].[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', GETDATE(), 28, '7:03d64aeed9cb52b969bd30a7ac0db57e', 'update', '', 'EXECUTED', NULL, NULL, '3.4.1')
GO

-- Changeset META-INF/jpa-changelog-2.1.0.xml::2.1.0::bburke@redhat.com
CREATE TABLE [dbo].[BROKER_LINK] ([IDENTITY_PROVIDER] [varchar](255) NOT NULL, [STORAGE_PROVIDER_ID] [varchar](255) NULL, [REALM_ID] [varchar](36) NOT NULL, [BROKER_USER_ID] [varchar](255) NULL, [BROKER_USERNAME] [varchar](255) NULL, [TOKEN] [text] NULL, [USER_ID] [varchar](255) NOT NULL)
GO

CREATE TABLE [dbo].[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) NULL, [VALUE] [varchar](2024) NULL)
GO

CREATE TABLE [dbo].[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) NULL)
GO

CREATE TABLE [dbo].[FED_USER_CONSENT_ROLE] ([USER_CONSENT_ID] [varchar](36) NOT NULL, [ROLE_ID] [varchar](36) NOT NULL)
GO

CREATE TABLE [dbo].[FED_USER_CONSENT_PROT_MAPPER] ([USER_CONSENT_ID] [varchar](36) NOT NULL, [PROTOCOL_MAPPER_ID] [varchar](36) NOT NULL)
GO

CREATE TABLE [dbo].[FED_USER_CREDENTIAL] ([ID] [varchar](36) NOT NULL, [DEVICE] [varchar](255) NULL, [HASH_ITERATIONS] [int] NULL, [SALT] [varbinary](16) NULL, [TYPE] [varchar](255) NULL, [VALUE] [varchar](255) NULL, [CREATED_DATE] [bigint] NULL, [COUNTER] [int] CONSTRAINT DF_FED_USER_CREDENTIAL_COUNTER DEFAULT 0 NULL, [DIGITS] [int] CONSTRAINT DF_FED_USER_CREDENTIAL_DIGITS DEFAULT 6 NULL, [PERIOD] [int] CONSTRAINT DF_FED_USER_CREDENTIAL_PERIOD DEFAULT 30 NULL, [ALGORITHM] [varchar](36) CONSTRAINT DF_FED_USER_CREDENTIAL_ALGORITHM DEFAULT 'HmacSHA1' NULL, [USER_ID] [varchar](255) NOT NULL, [REALM_ID] [varchar](36) NOT NULL, [STORAGE_PROVIDER_ID] [varchar](36) NULL)
GO

CREATE TABLE [dbo].[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) NULL)
GO

CREATE TABLE [dbo].[FED_USER_REQUIRED_ACTION] ([REQUIRED_ACTION] [varchar](255) CONSTRAINT DF_FED_USER_REQUIRED_ACTION_REQUIRED_ACTION DEFAULT ' ' NOT NULL, [USER_ID] [varchar](255) NOT NULL, [REALM_ID] [varchar](36) NOT NULL, [STORAGE_PROVIDER_ID] [varchar](36) NULL)
GO

CREATE TABLE [dbo].[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) NULL)
GO

CREATE TABLE [dbo].[COMPONENT_CONFIG] ([ID] [varchar](36) NOT NULL, [COMPONENT_ID] [varchar](36) NOT NULL, [NAME] [varchar](255) NOT NULL, [VALUE] [varchar](4000) NULL)
GO

CREATE TABLE [dbo].[COMPONENT] ([ID] [varchar](36) NOT NULL, [NAME] [varchar](255) NULL, [PARENT_ID] [varchar](36) NULL, [PROVIDER_ID] [varchar](36) NULL, [PROVIDER_TYPE] [varchar](255) NULL, [REALM_ID] [varchar](36) NULL)
GO

ALTER TABLE [dbo].[BROKER_LINK] ADD CONSTRAINT [CONSTR_BROKER_LINK_PK] PRIMARY KEY ([IDENTITY_PROVIDER], [USER_ID])
GO

ALTER TABLE [dbo].[FED_USER_ATTRIBUTE] ADD CONSTRAINT [CONSTR_FED_USER_ATTR_PK] PRIMARY KEY ([ID])
GO

ALTER TABLE [dbo].[FED_USER_CONSENT] ADD CONSTRAINT [CONSTR_FED_USER_CONSENT_PK] PRIMARY KEY ([ID])
GO

ALTER TABLE [dbo].[FED_USER_CONSENT_ROLE] ADD CONSTRAINT [CONSTR_USER_CONSENT_ROLE_PK] PRIMARY KEY ([USER_CONSENT_ID], [ROLE_ID])
GO

ALTER TABLE [dbo].[FED_USER_CONSENT_PROT_MAPPER] ADD CONSTRAINT [CONSTR_USER_CONSENT_PROTM_PK] PRIMARY KEY ([USER_CONSENT_ID], [PROTOCOL_MAPPER_ID])
GO

ALTER TABLE [dbo].[FED_USER_CREDENTIAL] ADD CONSTRAINT [CONSTR_FED_USER_CRED_PK] PRIMARY KEY ([ID])
GO

ALTER TABLE [dbo].[FED_USER_GROUP_MEMBERSHIP] ADD CONSTRAINT [CONSTR_FED_USER_GROUP] PRIMARY KEY ([GROUP_ID], [USER_ID])
GO

ALTER TABLE [dbo].[FED_USER_ROLE_MAPPING] ADD CONSTRAINT [CONSTR_FED_USER_ROLE] PRIMARY KEY ([ROLE_ID], [USER_ID])
GO

ALTER TABLE [dbo].[FED_USER_REQUIRED_ACTION] ADD CONSTRAINT [CONSTR_FED_REQUIRED_ACTION] PRIMARY KEY ([REQUIRED_ACTION], [USER_ID])
GO

ALTER TABLE [dbo].[COMPONENT] ADD CONSTRAINT [CONSTR_COMPONENT_PK] PRIMARY KEY ([ID])
GO

ALTER TABLE [dbo].[COMPONENT_CONFIG] ADD CONSTRAINT [CONSTR_COMPONENT_CONFIG_PK] PRIMARY KEY ([ID])
GO

ALTER TABLE [dbo].[COMPONENT] ADD CONSTRAINT [FK_COMPONENT_REALM] FOREIGN KEY ([REALM_ID]) REFERENCES [dbo].[REALM] ([ID])
GO

ALTER TABLE [dbo].[COMPONENT_CONFIG] ADD CONSTRAINT [FK_COMPONENT_CONFIG] FOREIGN KEY ([COMPONENT_ID]) REFERENCES [dbo].[COMPONENT] ([ID])
GO

INSERT INTO [dbo].[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', GETDATE(), 29, '7:e01599a82bf8d6dc22a9da506e22e868', 'createTable (x11), addPrimaryKey (x11), addForeignKeyConstraint (x2)', '', 'EXECUTED', NULL, NULL, '3.4.1')
GO

-- Changeset META-INF/jpa-changelog-2.2.0.xml::2.2.0::bburke@redhat.com
ALTER TABLE [dbo].[ADMIN_EVENT_ENTITY] ADD [RESOURCE_TYPE] [varchar](64)
GO

CREATE TABLE [dbo].[CREDENTIAL_ATTRIBUTE] ([ID] [varchar](36) NOT NULL, [CREDENTIAL_ID] [varchar](36) NOT NULL, [NAME] [varchar](255) NOT NULL, [VALUE] [varchar](4000) NULL)
GO

CREATE TABLE [dbo].[FED_CREDENTIAL_ATTRIBUTE] ([ID] [varchar](36) NOT NULL, [CREDENTIAL_ID] [varchar](36) NOT NULL, [NAME] [varchar](255) NOT NULL, [VALUE] [varchar](4000) NULL)
GO

ALTER TABLE [dbo].[CREDENTIAL] ALTER COLUMN [VALUE] [varchar](4000)
GO

ALTER TABLE [dbo].[FED_CREDENTIAL_ATTRIBUTE] ADD CONSTRAINT [FK_FED_CRED_ATTR] FOREIGN KEY ([CREDENTIAL_ID]) REFERENCES [dbo].[FED_USER_CREDENTIAL] ([ID])
GO

ALTER TABLE [dbo].[CREDENTIAL_ATTRIBUTE] ADD CONSTRAINT [FK_CRED_ATTR] FOREIGN KEY ([CREDENTIAL_ID]) REFERENCES [dbo].[CREDENTIAL] ([ID])
GO

INSERT INTO [dbo].[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', GETDATE(), 30, '7:53188c3eb1107546e6f765835705b6c1', 'addColumn, createTable (x2), modifyDataType, addForeignKeyConstraint (x2)', '', 'EXECUTED', NULL, NULL, '3.4.1')
GO

-- Changeset META-INF/jpa-changelog-2.3.0.xml::2.3.0::bburke@redhat.com
CREATE TABLE [dbo].[FEDERATED_USER] ([ID] [varchar](255) NOT NULL, [STORAGE_PROVIDER_ID] [varchar](255) NULL, [REALM_ID] [varchar](36) NOT NULL)
GO

ALTER TABLE [dbo].[FEDERATED_USER] ADD CONSTRAINT [CONSTR_FEDERATED_USER] PRIMARY KEY ([ID])
GO

DECLARE @sql [nvarchar](MAX)
SELECT @sql = N'ALTER TABLE [dbo].[USER_ENTITY] DROP CONSTRAINT ' + QUOTENAME([df].[name]) FROM [sys].[columns] AS [c] INNER JOIN [sys].[default_constraints] AS [df] ON [df].[object_id] = [c].[default_object_id] WHERE [c].[object_id] = OBJECT_ID(N'[dbo].[USER_ENTITY]') AND [c].[name] = N'TOTP'
EXEC sp_executesql @sql
GO

ALTER TABLE [dbo].[USER_ENTITY] DROP COLUMN [TOTP]
GO

ALTER TABLE [dbo].[IDENTITY_PROVIDER] ADD [PROVIDER_DISPLAY_NAME] [varchar](255)
GO

ALTER TABLE [dbo].[COMPONENT] ADD [SUB_TYPE] [varchar](255)
GO

INSERT INTO [dbo].[COMPONENT] ([ID], [REALM_ID], [PARENT_ID], [NAME], [PROVIDER_ID], [PROVIDER_TYPE]) VALUES ('dfaa6626-cc9b-47f9-a5b6-616b7e26eb70', 'master', 'master', 'rsa', 'rsa', 'org.keycloak.keys.KeyProvider')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('df89edfe-93b5-42e8-a195-53dfe01a543d', 'dfaa6626-cc9b-47f9-a5b6-616b7e26eb70', 'priority', '100')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('87143a4f-e41b-47f1-9129-7919f51893bc', 'dfaa6626-cc9b-47f9-a5b6-616b7e26eb70', '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')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('36589361-979e-4025-b63a-95f08fa6208f', 'dfaa6626-cc9b-47f9-a5b6-616b7e26eb70', 'certificate', 'MIICmzCCAYMCBgFXt/Tg9TANBgkqhkiG9w0BAQsFADARMQ8wDQYDVQQDDAZtYXN0ZXIwHhcNMTYxMDEyMDgxMjQxWhcNMjYxMDEyMDgxNDIxWjARMQ8wDQYDVQQDDAZtYXN0ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCJTng5egJsfLQvSAefXJqxy1ycodFTWkcUgmda9ojusKUnJ16310MlqJhc7Ewqx6IGbd5jOd83dw/JTy51iZGcy4qOKhxnvstPYgS20CNdvoaBrPHuWiuIUdHLQg4l5fgrFeEA9abGpreaQU18sES8WpVoGBQMdDrRyac+81Idi50FNb0rzSzye+Y/amyjsdPBYnX5dq2PUTL+BOYHcJeXKoF6AZYL1N64SsRiliF2H7XVNVZqyAwFnJQK0vc1E9oG6Fo+DUulbyVYaTTmdL5gzp29OTcymm/7PZHKASnHI7T2hPdvgb5l/CK3VJOqfQC8NMbMg12gpw20VJxXSPxPAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAC54wFHL8tmrksq4OzatzNUM+R+3Hu/VXX3T44dwg0EvXzGW45sME+gKCuleU1PabIrr6oFm0bBMTdxgE2hbLWpYbU3OcsjArpCeCsOlxrAkqhVQN161J+tp77JkDMgArFdwe3wh5bhvLaOZSt6Fsq+oo16CXG1obe1feyaK3+sU3YuDUIHE01UYtvwtfDsYBC+VDyTdNDbB15WcdRoGljJY/JiT0JHdmAfq8qdGDuxGocIV0lSB8bO5JwF/WCmKqMrnh5j1NfGcE1g26Hbz2RmDs17X0K10Okzs/qz1YZqDjPVYiU//VFQQro71/D35dPOJv8mQMjhjNaXScL44h7w=')
GO

INSERT INTO [dbo].[COMPONENT] ([ID], [REALM_ID], [PARENT_ID], [NAME], [PROVIDER_ID], [PROVIDER_TYPE]) VALUES ('8fe41e18-c8fd-421d-a6ab-2a0d59881a0a', 'Migration', 'Migration', 'rsa', 'rsa', 'org.keycloak.keys.KeyProvider')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('1eaf5eee-95f1-4f5e-bb5b-d096fba20a98', '8fe41e18-c8fd-421d-a6ab-2a0d59881a0a', 'priority', '100')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('f9869835-2e9f-42f1-919f-d47e0c663ffe', '8fe41e18-c8fd-421d-a6ab-2a0d59881a0a', '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==')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('d678b0a2-fe24-46b6-8ae7-88e320e1939a', '8fe41e18-c8fd-421d-a6ab-2a0d59881a0a', '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=')
GO

INSERT INTO [dbo].[COMPONENT] ([ID], [REALM_ID], [PARENT_ID], [NAME], [PROVIDER_ID], [PROVIDER_TYPE]) VALUES ('82c2f336-45a8-4c7f-ac9e-77d5bf296796', 'Migration2', 'Migration2', 'rsa', 'rsa', 'org.keycloak.keys.KeyProvider')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('73c77c50-7d97-4159-b640-0237d8a14fb3', '82c2f336-45a8-4c7f-ac9e-77d5bf296796', 'priority', '100')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('be0a40ee-735e-45a9-af35-d0cf240a89f2', '82c2f336-45a8-4c7f-ac9e-77d5bf296796', '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')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('0ada697e-2f78-4869-96f9-b835509bbf25', '82c2f336-45a8-4c7f-ac9e-77d5bf296796', '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==')
GO

ALTER TABLE [dbo].[REALM] DROP COLUMN [CODE_SECRET]
GO

ALTER TABLE [dbo].[REALM] DROP COLUMN [PRIVATE_KEY]
GO

ALTER TABLE [dbo].[REALM] DROP COLUMN [PUBLIC_KEY]
GO

ALTER TABLE [dbo].[REALM] DROP COLUMN [CERTIFICATE]
GO

ALTER TABLE [dbo].[USER_CONSENT] ADD [CREATED_DATE] [bigint]
GO

ALTER TABLE [dbo].[USER_CONSENT] ADD [LAST_UPDATED_DATE] [bigint]
GO

INSERT INTO [dbo].[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', GETDATE(), 31, '7:d6e6f3bc57a0c5586737d1351725d4d4', 'createTable, addPrimaryKey, dropDefaultValue, dropColumn, addColumn (x2), customChange, dropColumn (x4), addColumn', '', 'EXECUTED', NULL, NULL, '3.4.1')
GO

-- Changeset META-INF/jpa-changelog-2.4.0.xml::2.4.0::bburke@redhat.com
INSERT INTO [dbo].[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')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('997b3684-1b77-4f78-87f5-00ce1932b45f', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'priority', '2')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('4ff4f6b5-d1d3-4c7e-9bb3-884fed464ea8', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'fullSyncPeriod', '-1')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('ad5e1ce3-a37e-4b44-82d2-f615e31b60de', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'changedSyncPeriod', '-1')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('32912b92-69a1-4306-b679-e0fd3861c723', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'lastSync', '0')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('f8c98b28-8c00-419d-a8ce-a32793b38514', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'allowKerberosAuthentication', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('ff90acc6-7e6a-4947-863e-c42d6ec0cacd', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'authType', 'none')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('1f924980-c915-4d82-8bed-5e1febbad3da', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'batchSizeForSync', '1001')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('87cfb14e-ca82-4d09-82f8-a0b78a70c660', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'connectionPooling', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('1c0b4094-342c-4139-991b-e80a8c5fdd97', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'connectionUrl', 'http://localhost')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('f24f448f-f949-4711-879c-055a1ad8f5c6', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'debug', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('108d6520-9425-4e1b-b0b5-2d4c892954b5', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'editMode', 'READ_ONLY')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('de09ecbb-4cc8-4e42-b8c3-f49eabd657f8', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'kerberosRealm', 'realm')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('a458df0a-5806-4b63-8507-1e5c64304475', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'keyTab', 'keytab')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('e087eaa8-d5ab-461b-ae3c-7c25e72aee66', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'pagination', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('75f9436c-ff08-497f-a691-7b69919d4a2b', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'rdnLDAPAttribute', 'uid')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('7abeca7d-ece3-40ad-b29e-460a64676b60', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'searchScope', '1')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('9884f8e5-f153-4672-840a-d637e1878406', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'serverPrincipal', 'principal')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('6186ea17-0cfb-45e7-aeb3-7d9585b9414f', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'syncRegistrations', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('3a8fba23-ec6d-4fb6-a6ca-d1a2ab049596', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'useKerberosForPasswordAuthentication', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('803ab500-f31e-42ea-ae90-372ac265b579', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'userAccountControlsAfterPasswordUpdate', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('140a15e5-3837-440f-9c8e-54a950392e2c', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'usernameLDAPAttribute', 'uid')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('68995224-72c3-4547-aac3-1f383f9b8413', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'userObjectClasses', 'inetOrgPerson, organizationalPerson')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('d39396e4-99a9-4b4c-accb-ac62e9faba99', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'usersDn', 'dn')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('1fde8411-9c51-458d-9d4e-60a7eb05d8d7', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'useTruststoreSpi', 'ldapsOnly')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('647f085e-974f-4a25-ad49-bdfeb1bb2cae', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'uuidLDAPAttribute', 'nsuniqueid')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('0bec6440-d35d-4e11-9fb1-d77b1c1ea590', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'vendor', 'rhds')
GO

INSERT INTO [dbo].[COMPONENT] ([ID], [REALM_ID], [PARENT_ID], [NAME], [PROVIDER_ID], [PROVIDER_TYPE]) VALUES ('3f31f0e8-00ea-4b52-90ba-131357149d59', 'Migration2', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'creation date', 'user-attribute-ldap-mapper', 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('d907de2c-e482-42ef-b4f4-439c47d709f4', '3f31f0e8-00ea-4b52-90ba-131357149d59', 'always.read.value.from.ldap', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('e35065fb-7f27-4ee7-a312-18123c2b5767', '3f31f0e8-00ea-4b52-90ba-131357149d59', 'is.mandatory.in.ldap', 'false')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('13a0a398-d402-4382-b232-081885653a0c', '3f31f0e8-00ea-4b52-90ba-131357149d59', 'ldap.attribute', 'createTimestamp')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('ee098f09-b092-4a10-b4c3-1d7601eaeb0a', '3f31f0e8-00ea-4b52-90ba-131357149d59', 'read.only', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('458fcb96-e263-48cc-a5d0-78646b4f2069', '3f31f0e8-00ea-4b52-90ba-131357149d59', 'user.model.attribute', 'createTimestamp')
GO

DELETE FROM [dbo].[USER_FEDERATION_MAPPER_CONFIG] WHERE USER_FEDERATION_MAPPER_ID='3f31f0e8-00ea-4b52-90ba-131357149d59'
GO

DELETE FROM [dbo].[USER_FEDERATION_MAPPER] WHERE ID='3f31f0e8-00ea-4b52-90ba-131357149d59'
GO

INSERT INTO [dbo].[COMPONENT] ([ID], [REALM_ID], [PARENT_ID], [NAME], [PROVIDER_ID], [PROVIDER_TYPE]) VALUES ('7900e626-a8ec-4792-ba1e-ab7619aa60d6', 'Migration2', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'modify date', 'user-attribute-ldap-mapper', 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('e4bcf1cc-739e-47cf-a11b-155ad7240422', '7900e626-a8ec-4792-ba1e-ab7619aa60d6', 'always.read.value.from.ldap', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('6c49cb3a-f91d-49e5-90d0-71d993e349d4', '7900e626-a8ec-4792-ba1e-ab7619aa60d6', 'is.mandatory.in.ldap', 'false')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('dd3af2b1-cfe1-47b6-9d3a-cefbfc872648', '7900e626-a8ec-4792-ba1e-ab7619aa60d6', 'ldap.attribute', 'modifyTimestamp')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('4659bf51-caca-474c-9b0b-dd359055a1dc', '7900e626-a8ec-4792-ba1e-ab7619aa60d6', 'read.only', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('fcacfcdc-61c0-42e9-9b9a-751c06239dc2', '7900e626-a8ec-4792-ba1e-ab7619aa60d6', 'user.model.attribute', 'modifyTimestamp')
GO

DELETE FROM [dbo].[USER_FEDERATION_MAPPER_CONFIG] WHERE USER_FEDERATION_MAPPER_ID='7900e626-a8ec-4792-ba1e-ab7619aa60d6'
GO

DELETE FROM [dbo].[USER_FEDERATION_MAPPER] WHERE ID='7900e626-a8ec-4792-ba1e-ab7619aa60d6'
GO

INSERT INTO [dbo].[COMPONENT] ([ID], [REALM_ID], [PARENT_ID], [NAME], [PROVIDER_ID], [PROVIDER_TYPE]) VALUES ('b2d6a981-b204-4f99-b053-d80ce1e8720a', 'Migration2', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'username', 'user-attribute-ldap-mapper', 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('0d8fd437-d03b-401f-b6bf-8c19cbc25309', 'b2d6a981-b204-4f99-b053-d80ce1e8720a', 'always.read.value.from.ldap', 'false')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('93b2b4ea-4fc9-4cf6-8b5c-68724e7a6aee', 'b2d6a981-b204-4f99-b053-d80ce1e8720a', 'is.mandatory.in.ldap', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('27260a3b-2f94-4c06-9850-ba50fcf56281', 'b2d6a981-b204-4f99-b053-d80ce1e8720a', 'ldap.attribute', 'uid')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('3f16a6aa-424a-40c9-90e5-5ec1c54c4491', 'b2d6a981-b204-4f99-b053-d80ce1e8720a', 'read.only', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('599d735a-1f66-4473-abbc-4cd8f01a6900', 'b2d6a981-b204-4f99-b053-d80ce1e8720a', 'user.model.attribute', 'username')
GO

DELETE FROM [dbo].[USER_FEDERATION_MAPPER_CONFIG] WHERE USER_FEDERATION_MAPPER_ID='b2d6a981-b204-4f99-b053-d80ce1e8720a'
GO

DELETE FROM [dbo].[USER_FEDERATION_MAPPER] WHERE ID='b2d6a981-b204-4f99-b053-d80ce1e8720a'
GO

INSERT INTO [dbo].[COMPONENT] ([ID], [REALM_ID], [PARENT_ID], [NAME], [PROVIDER_ID], [PROVIDER_TYPE]) VALUES ('b4da2706-6f97-4bab-8196-e48398c93173', 'Migration2', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'email', 'user-attribute-ldap-mapper', 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('ef3653d7-b795-4745-8a9a-3311a2fe3291', 'b4da2706-6f97-4bab-8196-e48398c93173', 'always.read.value.from.ldap', 'false')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('9cfb0047-3cc4-4d70-9373-3495f9f8d677', 'b4da2706-6f97-4bab-8196-e48398c93173', 'is.mandatory.in.ldap', 'false')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('e3db2f53-fa10-4bc0-923b-ed770eff9d08', 'b4da2706-6f97-4bab-8196-e48398c93173', 'ldap.attribute', 'mail')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('b9f567ae-0e94-4bbc-9b04-583fc27fc4c4', 'b4da2706-6f97-4bab-8196-e48398c93173', 'read.only', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('6fb746c7-71df-412b-8f3a-98a88e226b70', 'b4da2706-6f97-4bab-8196-e48398c93173', 'user.model.attribute', 'email')
GO

DELETE FROM [dbo].[USER_FEDERATION_MAPPER_CONFIG] WHERE USER_FEDERATION_MAPPER_ID='b4da2706-6f97-4bab-8196-e48398c93173'
GO

DELETE FROM [dbo].[USER_FEDERATION_MAPPER] WHERE ID='b4da2706-6f97-4bab-8196-e48398c93173'
GO

INSERT INTO [dbo].[COMPONENT] ([ID], [REALM_ID], [PARENT_ID], [NAME], [PROVIDER_ID], [PROVIDER_TYPE]) VALUES ('b543fb74-6d61-4fdc-ae7d-04c2889ba832', 'Migration2', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'last name', 'user-attribute-ldap-mapper', 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('ad4dc090-0f38-495c-b8d0-bc394e1afaae', 'b543fb74-6d61-4fdc-ae7d-04c2889ba832', 'always.read.value.from.ldap', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('fc7d0626-5174-4d67-b4e8-3313b3bcca79', 'b543fb74-6d61-4fdc-ae7d-04c2889ba832', 'is.mandatory.in.ldap', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('9ad90958-40a5-496c-9b3d-5a8653c9a479', 'b543fb74-6d61-4fdc-ae7d-04c2889ba832', 'ldap.attribute', 'sn')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('dcd4f010-24f2-402a-91cd-e2f4e0654d57', 'b543fb74-6d61-4fdc-ae7d-04c2889ba832', 'read.only', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('a7a1d1cb-2107-43ff-b5e7-b1df13213dc6', 'b543fb74-6d61-4fdc-ae7d-04c2889ba832', 'user.model.attribute', 'lastName')
GO

DELETE FROM [dbo].[USER_FEDERATION_MAPPER_CONFIG] WHERE USER_FEDERATION_MAPPER_ID='b543fb74-6d61-4fdc-ae7d-04c2889ba832'
GO

DELETE FROM [dbo].[USER_FEDERATION_MAPPER] WHERE ID='b543fb74-6d61-4fdc-ae7d-04c2889ba832'
GO

INSERT INTO [dbo].[COMPONENT] ([ID], [REALM_ID], [PARENT_ID], [NAME], [PROVIDER_ID], [PROVIDER_TYPE]) VALUES ('ef23733c-eb2f-42e4-be64-87b1e9f57fda', 'Migration2', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'first name', 'user-attribute-ldap-mapper', 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('df474454-f0fa-431e-b544-8c2cc43d2f5d', 'ef23733c-eb2f-42e4-be64-87b1e9f57fda', 'always.read.value.from.ldap', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('484ea200-e663-4e4e-8ec7-849d7294811b', 'ef23733c-eb2f-42e4-be64-87b1e9f57fda', 'is.mandatory.in.ldap', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('4b7255e6-ee37-40ee-b3e3-48e3505d09d1', 'ef23733c-eb2f-42e4-be64-87b1e9f57fda', 'ldap.attribute', 'cn')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('09146e1b-8eef-4d00-8d38-6ba491f127cc', 'ef23733c-eb2f-42e4-be64-87b1e9f57fda', 'read.only', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('a53029c0-1666-489b-93fc-341be9100154', 'ef23733c-eb2f-42e4-be64-87b1e9f57fda', 'user.model.attribute', 'firstName')
GO

DELETE FROM [dbo].[USER_FEDERATION_MAPPER_CONFIG] WHERE USER_FEDERATION_MAPPER_ID='ef23733c-eb2f-42e4-be64-87b1e9f57fda'
GO

DELETE FROM [dbo].[USER_FEDERATION_MAPPER] WHERE ID='ef23733c-eb2f-42e4-be64-87b1e9f57fda'
GO

DELETE FROM [dbo].[USER_FEDERATION_CONFIG] WHERE USER_FEDERATION_PROVIDER_ID='4dd39136-ae1f-4cb7-b769-ce97e1865aa6'
GO

DELETE FROM [dbo].[USER_FEDERATION_PROVIDER] WHERE ID='4dd39136-ae1f-4cb7-b769-ce97e1865aa6'
GO

INSERT INTO [dbo].[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', GETDATE(), 32, '7:454d604fbd755d9df3fd9c6329043aa5', 'customChange', '', 'EXECUTED', NULL, NULL, '3.4.1')
GO

-- Changeset META-INF/jpa-changelog-2.5.0.xml::2.5.0::bburke@redhat.com
INSERT INTO [dbo].[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')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('4a7cf138-e4eb-48cd-8a39-c71ca24bcd82', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'priority', '2')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('e141a10d-7f36-4b15-b3dd-5defc9889e18', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'fullSyncPeriod', '-1')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('f5f24791-9e4a-445c-9b67-160ddc7951cd', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'changedSyncPeriod', '-1')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('371e97f4-175d-4f7d-8278-c3d6eef8e08f', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'lastSync', '0')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('ccbf1213-9d06-4ebe-9087-b2e534850a86', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'allowKerberosAuthentication', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('7d327da7-5a09-40ff-97d9-1217579943c8', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'authType', 'none')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('8eb8588d-2558-400b-aaf7-e67eb91a27e2', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'batchSizeForSync', '1001')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('9f2d7d11-47c7-4b00-9689-0661716c7db6', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'connectionPooling', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('48e93fd5-f6d3-47a4-bb7b-255d14f78e29', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'connectionUrl', 'http://localhost')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('948183e3-8e69-441a-8857-38721ce37259', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'debug', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('c2f8c659-f5ff-4ee3-9043-2efcf1a4867f', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'editMode', 'READ_ONLY')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('aecb93d9-a192-4abf-ad82-47a6bc016e9e', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'kerberosRealm', 'realm')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('9d867243-0c49-4091-8166-3e90c2ccdcb9', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'keyTab', 'keytab')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('bf7863d5-57c8-4a6f-892f-29bd19890325', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'pagination', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('bfe6bde5-5960-4d50-8caa-f9fbb826b0e0', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'rdnLDAPAttribute', 'uid')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('a7a703e0-6a3a-4573-aede-3176dfb61393', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'searchScope', '1')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('06547002-c5c0-4698-b6ba-d0fdd8c0d7b6', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'serverPrincipal', 'principal')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('973afc80-012b-4c42-8f55-f5e7c80aa42c', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'syncRegistrations', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('086f3f9e-94af-4cbe-b134-4c0a9e6ab282', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'useKerberosForPasswordAuthentication', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('efe32d29-d005-480c-8664-b4224984c62f', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'userAccountControlsAfterPasswordUpdate', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('91a54c65-af04-4190-8c5f-87be66c1c3f0', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'usernameLDAPAttribute', 'uid')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('59c2c34c-1024-48c6-8758-8eb959bbcbef', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'userObjectClasses', 'inetOrgPerson, organizationalPerson')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('27ea1c24-582c-4e9b-b87d-8338df4ba4d5', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'usersDn', 'dn')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('91c93bfe-f62e-44f4-a453-dc2b65fa299d', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'useTruststoreSpi', 'ldapsOnly')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('ff45f318-e9c9-4b10-9676-58344ad651bb', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'uuidLDAPAttribute', 'nsuniqueid')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('f694e736-fb98-4c16-97db-dbfcf1275e91', '4dd39136-ae1f-4cb7-b769-ce97e1865aa6', 'vendor', 'rhds')
GO

DELETE FROM [dbo].[USER_FEDERATION_CONFIG] WHERE USER_FEDERATION_PROVIDER_ID='4dd39136-ae1f-4cb7-b769-ce97e1865aa6'
GO

DELETE FROM [dbo].[USER_FEDERATION_PROVIDER] WHERE ID='4dd39136-ae1f-4cb7-b769-ce97e1865aa6'
GO

INSERT INTO [dbo].[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')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('36db8c93-f1b9-4632-b305-26f10845e03b', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'priority', '3')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('48af3b66-a25e-4329-8e0d-0d1cd5771658', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'fullSyncPeriod', '0')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('073877fc-4d2e-42f1-8fcc-99ed307439c3', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'changedSyncPeriod', '0')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('318462cc-e641-4259-b29f-51f10d5c6296', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'lastSync', '0')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('7f8a13b2-053e-4752-8e2a-ce582aa43589', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'allowKerberosAuthentication', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('c464a833-002f-455a-a218-608ec4750c29', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'allowPasswordAuthentication', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('ed7c840f-c91f-4e0c-9b72-44b9572922c1', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'debug', 'true')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('8c7cc41f-ddb3-469a-a794-592d98880655', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'editMode', 'READ_ONLY')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('ff2bca82-a7e2-44f3-a54f-f9252ed81b7f', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'kerberosRealm', 'realm')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('57742f0a-3c3e-4e18-ad1a-aa1fd1cb9548', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'keyTab', 'keytab')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('fb326a0a-3a59-40f9-bc10-210c3d42526a', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'serverPrincipal', 'principal')
GO

INSERT INTO [dbo].[COMPONENT_CONFIG] ([ID], [COMPONENT_ID], [NAME], [VALUE]) VALUES ('347c7c2b-f619-4813-ab2a-c55189cc5cd1', '03b669fa-f86f-42fb-b4a4-88315b3ebeb6', 'updateProfileFirstLogin', 'true')
GO

DELETE FROM [dbo].[USER_FEDERATION_CONFIG] WHERE USER_FEDERATION_PROVIDER_ID='03b669fa-f86f-42fb-b4a4-88315b3ebeb6'
GO

DELETE FROM [dbo].[USER_FEDERATION_PROVIDER] WHERE ID='03b669fa-f86f-42fb-b4a4-88315b3ebeb6'
GO

ALTER TABLE [dbo].[OFFLINE_USER_SESSION] ALTER COLUMN [USER_ID] [varchar](255)
GO

INSERT INTO [dbo].[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', GETDATE(), 33, '7:57e98a3077e29caf562f7dbf80c72600', 'customChange, modifyDataType', '', 'EXECUTED', NULL, NULL, '3.4.1')
GO

-- Changeset META-INF/jpa-changelog-2.5.0.xml::2.5.0-unicode-oracle::hmlnarik@redhat.com
INSERT INTO [dbo].[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', GETDATE(), 34, '7:e4c7e8f2256210aee71ddc42f538b57a', 'modifyDataType (x13), addColumn, sql, dropColumn, renameColumn, modifyDataType (x2)', '', 'MARK_RAN', NULL, NULL, '3.4.1')
GO

-- Changeset META-INF/jpa-changelog-2.5.0.xml::2.5.0-unicode-other-dbs::hmlnarik@redhat.com
ALTER TABLE [dbo].[AUTHENTICATION_FLOW] ALTER COLUMN [DESCRIPTION] [nvarchar](255)
GO

ALTER TABLE [dbo].[CLIENT_TEMPLATE] ALTER COLUMN [DESCRIPTION] [nvarchar](255)
GO

ALTER TABLE [dbo].[RESOURCE_SERVER_POLICY] ALTER COLUMN [DESCRIPTION] [nvarchar](255)
GO

ALTER TABLE [dbo].[CLIENT] ALTER COLUMN [DESCRIPTION] [nvarchar](255)
GO

ALTER TABLE [dbo].[CLIENT] ALTER COLUMN [NAME] [nvarchar](255)
GO

ALTER TABLE [dbo].[USER_ENTITY] DROP CONSTRAINT [UK_RU8TT6T700S9V50BU18WS5HA6]
GO

ALTER TABLE [dbo].[USER_ENTITY] ALTER COLUMN [FIRST_NAME] [nvarchar](255)
GO

ALTER TABLE [dbo].[USER_ENTITY] ALTER COLUMN [LAST_NAME] [nvarchar](255)
GO

ALTER TABLE [dbo].[USER_ENTITY] ALTER COLUMN [USERNAME] [nvarchar](255)
GO

ALTER TABLE [dbo].[USER_ENTITY] ADD CONSTRAINT [UK_RU8TT6T700S9V50BU18WS5HA6] UNIQUE ([REALM_ID], [USERNAME])
GO

ALTER TABLE [dbo].[USERNAME_LOGIN_FAILURE] DROP CONSTRAINT [CONSTRAINT_17]
GO

ALTER TABLE [dbo].[USERNAME_LOGIN_FAILURE] ALTER COLUMN [USERNAME] [nvarchar](255)
GO

ALTER TABLE [dbo].[USERNAME_LOGIN_FAILURE] ALTER COLUMN [USERNAME] [nvarchar](255) NOT NULL
GO

ALTER TABLE [dbo].[USERNAME_LOGIN_FAILURE] ADD CONSTRAINT [CONSTRAINT_17-2] PRIMARY KEY ([REALM_ID], [USERNAME])
GO

ALTER TABLE [dbo].[KEYCLOAK_GROUP] ALTER COLUMN [NAME] [nvarchar](255)
GO

ALTER TABLE [dbo].[USER_ATTRIBUTE] ALTER COLUMN [VALUE] [nvarchar](255)
GO

ALTER TABLE [dbo].[GROUP_ATTRIBUTE] ALTER COLUMN [VALUE] [nvarchar](255)
GO

ALTER TABLE [dbo].[REALM_ATTRIBUTE] ALTER COLUMN [VALUE] [nvarchar](255)
GO

ALTER TABLE [dbo].[COMPONENT_CONFIG] ALTER COLUMN [VALUE] [nvarchar](4000)
GO

ALTER TABLE [dbo].[KEYCLOAK_ROLE] DROP CONSTRAINT [UK_J3RWUVD56ONTGSUHOGM184WW2-2]
GO

ALTER TABLE [dbo].[KEYCLOAK_ROLE] ALTER COLUMN [NAME] [nvarchar](255)
GO

ALTER TABLE [dbo].[KEYCLOAK_ROLE] ADD CONSTRAINT [UK_J3RWUVD56ONTGSUHOGM184WW2-2] UNIQUE ([NAME], [CLIENT_REALM_CONSTRAINT])
GO

ALTER TABLE [dbo].[KEYCLOAK_ROLE] ALTER COLUMN [DESCRIPTION] [nvarchar](255)
GO

INSERT INTO [dbo].[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', GETDATE(), 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')
GO

-- Changeset META-INF/jpa-changelog-2.5.0.xml::2.5.0-duplicate-email-support::slawomir@dabek.name
ALTER TABLE [dbo].[REALM] ADD [LOGIN_WITH_EMAIL_ALLOWED] [bit] NOT NULL CONSTRAINT DF_REALM_LOGIN_WITH_EMAIL_ALLOWED DEFAULT 1
GO

ALTER TABLE [dbo].[REALM] ADD [DUPLICATE_EMAILS_ALLOWED] [bit] NOT NULL CONSTRAINT DF_REALM_DUPLICATE_EMAILS_ALLOWED DEFAULT 0
GO

INSERT INTO [dbo].[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', GETDATE(), 36, '7:26bfc7c74fefa9126f2ce702fb775553', 'addColumn', '', 'EXECUTED', NULL, NULL, '3.4.1')
GO

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

INSERT INTO [dbo].[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', GETDATE(), 37, '7:a161e2ae671a9020fff61e996a207377', 'addUniqueConstraint', '', 'EXECUTED', NULL, NULL, '3.4.1')
GO

-- Changeset META-INF/jpa-changelog-2.5.1.xml::2.5.1::bburke@redhat.com
ALTER TABLE [dbo].[FED_USER_CONSENT] ADD [CREATED_DATE] [bigint]
GO

ALTER TABLE [dbo].[FED_USER_CONSENT] ADD [LAST_UPDATED_DATE] [bigint]
GO

INSERT INTO [dbo].[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', GETDATE(), 38, '7:37fc1781855ac5388c494f1442b3f717', 'addColumn', '', 'EXECUTED', NULL, NULL, '3.4.1')
GO

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

CREATE TABLE [dbo].[DATABASECHANGELOG_EXAMPLE_EN] ([ID] [nvarchar](255) NOT NULL, [AUTHOR] [nvarchar](255) NOT NULL, [FILENAME] [nvarchar](255) NOT NULL, [DATEEXECUTED] [datetime2](3) NOT NULL, [ORDEREXECUTED] [int] NOT NULL, [EXECTYPE] [nvarchar](10) NOT NULL, [MD5SUM] [nvarchar](35) NULL, [DESCRIPTION] [nvarchar](255) NULL, [COMMENTS] [nvarchar](255) NULL, [TAG] [nvarchar](255) NULL, [LIQUIBASE] [nvarchar](20) NULL, [CONTEXTS] [nvarchar](255) NULL, [LABELS] [nvarchar](255) NULL)
GO

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

-- *********************************************************************
-- Update Database Script
-- *********************************************************************
-- Change Log: META-INF/example-changelog.xml
-- Ran at: 2/1/17 8:01 AM
-- Against: dballo19@jdbc:sqlserver://db-25.rhev-ci-vms.eng.rdu2.redhat.com:1433;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustServerCertificate=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;packetSize=8000;multiSubnetFailover=false;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=dballo19;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite;
-- Liquibase version: 3.4.1
-- *********************************************************************

USE [dballo19];
GO

-- Changeset META-INF/example-changelog.xml::example-1.0::erik.mulder@docdatapayments.com
CREATE TABLE [dbo].[EXAMPLE_COMPANY] ([ID] [varchar](36) NOT NULL, [NAME] [varchar](255) NOT NULL, [REALM_ID] [varchar](36) NOT NULL)
GO

ALTER TABLE [dbo].[EXAMPLE_COMPANY] ADD CONSTRAINT [PK_COMPANY] PRIMARY KEY ([ID])
GO

INSERT INTO [dbo].[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', GETDATE(), 1, '7:4eb040a6f792db674a0fdd7c79db2cc3', 'createTable, addPrimaryKey', '', 'EXECUTED', NULL, NULL, '3.4.1')
GO

