keycloak-scim/model/jpa/src/main/resources/META-INF/jpa-changelog-2.1.0.xml

198 lines
9.9 KiB
XML
Raw Normal View History

2016-06-30 20:47:49 +00:00
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
~ Copyright 2016 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
2016-07-07 14:35:35 +00:00
<changeSet author="bburke@redhat.com" id="2.1.0">
2016-06-30 20:47:49 +00:00
2016-07-07 14:35:35 +00:00
<createTable tableName="BROKER_LINK">
<column name="IDENTITY_PROVIDER" type="VARCHAR(255)">
<constraints nullable="false" />
</column>
<column name="STORAGE_PROVIDER_ID" type="VARCHAR(255)">
</column>
<column name="REALM_ID" type="VARCHAR(36)">
<constraints nullable="false" />
2016-06-30 20:47:49 +00:00
</column>
2016-07-07 14:35:35 +00:00
<column name="BROKER_USER_ID" type="VARCHAR(255)" />
<column name="BROKER_USERNAME" type="VARCHAR(255)" />
<column name="TOKEN" type="TEXT" />
<column name="USER_ID" type="VARCHAR(255)">
<constraints nullable="false" />
</column>
</createTable>
<createTable tableName="FED_USER_ATTRIBUTE">
2016-06-30 20:47:49 +00:00
<column name="ID" type="VARCHAR(36)">
2016-07-07 14:35:35 +00:00
<constraints nullable="false" />
2016-06-30 20:47:49 +00:00
</column>
2016-07-07 14:35:35 +00:00
<column name="NAME" type="VARCHAR(255)">
2016-06-30 20:47:49 +00:00
<constraints nullable="false"/>
</column>
2016-07-07 14:35:35 +00:00
<column name="USER_ID" type="VARCHAR(255)">
2016-06-30 20:47:49 +00:00
<constraints nullable="false"/>
</column>
2016-07-07 14:35:35 +00:00
<column name="REALM_ID" type="VARCHAR(36)">
2016-06-30 20:47:49 +00:00
<constraints nullable="false"/>
</column>
2016-07-07 14:35:35 +00:00
<column name="STORAGE_PROVIDER_ID" type="VARCHAR(36)"/>
<column name="VALUE" type="VARCHAR(2024)"/>
</createTable>
<createTable tableName="FED_USER_CONSENT">
<column name="ID" type="VARCHAR(36)">
2016-06-30 20:47:49 +00:00
<constraints nullable="false"/>
</column>
2016-07-07 14:35:35 +00:00
<column name="CLIENT_ID" type="VARCHAR(36)">
2016-06-30 20:47:49 +00:00
<constraints nullable="false"/>
</column>
2016-07-07 14:35:35 +00:00
<column name="USER_ID" type="VARCHAR(255)">
2016-06-30 20:47:49 +00:00
<constraints nullable="false"/>
</column>
2016-07-07 14:35:35 +00:00
<column name="REALM_ID" type="VARCHAR(36)">
2016-06-30 20:47:49 +00:00
<constraints nullable="false"/>
</column>
2016-07-07 14:35:35 +00:00
<column name="STORAGE_PROVIDER_ID" type="VARCHAR(36)"/>
</createTable>
<createTable tableName="FED_USER_CONSENT_ROLE">
<column name="USER_CONSENT_ID" type="VARCHAR(36)">
2016-06-30 20:47:49 +00:00
<constraints nullable="false"/>
</column>
2016-07-07 14:35:35 +00:00
<column name="ROLE_ID" type="VARCHAR(36)">
2016-06-30 20:47:49 +00:00
<constraints nullable="false"/>
</column>
</createTable>
2016-07-07 14:35:35 +00:00
<createTable tableName="FED_USER_CONSENT_PROT_MAPPER">
<column name="USER_CONSENT_ID" type="VARCHAR(36)">
2016-06-30 20:47:49 +00:00
<constraints nullable="false"/>
</column>
2016-07-07 14:35:35 +00:00
<column name="PROTOCOL_MAPPER_ID" type="VARCHAR(36)">
2016-06-30 20:47:49 +00:00
<constraints nullable="false"/>
</column>
</createTable>
2016-07-07 14:35:35 +00:00
<createTable tableName="FED_USER_CREDENTIAL">
<column name="ID" type="VARCHAR(36)">
2016-06-30 20:47:49 +00:00
<constraints nullable="false"/>
</column>
2016-07-07 14:35:35 +00:00
<column name="DEVICE" type="VARCHAR(255)"/>
<column name="HASH_ITERATIONS" type="INT"/>
<column name="SALT" type="BLOB(16)"/>
<column name="TYPE" type="VARCHAR(255)"/>
<column name="VALUE" type="VARCHAR(255)"/>
<column name="CREATED_DATE" type="BIGINT"/>
<column name="COUNTER" type="INT" defaultValueNumeric="0">
<constraints nullable="true"/>
</column>
<column name="DIGITS" type="INT" defaultValueNumeric="6">
<constraints nullable="true"/>
</column>
<column name="PERIOD" type="INT" defaultValueNumeric="30">
<constraints nullable="true"/>
</column>
<column name="ALGORITHM" type="VARCHAR(36)" defaultValue="HmacSHA1">
<constraints nullable="true"/>
</column>
<column name="USER_ID" type="VARCHAR(255)">
2016-06-30 20:47:49 +00:00
<constraints nullable="false"/>
</column>
2016-07-07 14:35:35 +00:00
<column name="REALM_ID" type="VARCHAR(36)">
<constraints nullable="false"/>
</column>
<column name="STORAGE_PROVIDER_ID" type="VARCHAR(36)"/>
2016-06-30 20:47:49 +00:00
</createTable>
2016-07-07 14:35:35 +00:00
<createTable tableName="FED_USER_GROUP_MEMBERSHIP">
<column name="GROUP_ID" type="VARCHAR(36)">
<constraints nullable="false"/>
2016-06-30 20:47:49 +00:00
</column>
2016-07-07 14:35:35 +00:00
<column name="USER_ID" type="VARCHAR(255)">
2016-06-30 20:47:49 +00:00
<constraints nullable="false"/>
</column>
2016-07-07 14:35:35 +00:00
<column name="REALM_ID" type="VARCHAR(36)">
2016-06-30 20:47:49 +00:00
<constraints nullable="false"/>
</column>
2016-07-07 14:35:35 +00:00
<column name="STORAGE_PROVIDER_ID" type="VARCHAR(36)"/>
</createTable>
<createTable tableName="FED_USER_REQUIRED_ACTION">
<column name="REQUIRED_ACTION" type="VARCHAR(255)" defaultValue=" ">
2016-06-30 20:47:49 +00:00
<constraints nullable="false"/>
</column>
2016-07-07 14:35:35 +00:00
<column name="USER_ID" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="REALM_ID" type="VARCHAR(36)">
<constraints nullable="false"/>
</column>
<column name="STORAGE_PROVIDER_ID" type="VARCHAR(36)"/>
</createTable>
<createTable tableName="FED_USER_ROLE_MAPPING">
<column name="ROLE_ID" type="VARCHAR(36)">
<constraints nullable="false"/>
2016-06-30 20:47:49 +00:00
</column>
2016-07-07 14:35:35 +00:00
<column name="USER_ID" type="VARCHAR(255)">
2016-06-30 20:47:49 +00:00
<constraints nullable="false"/>
</column>
<column name="REALM_ID" type="VARCHAR(36)">
<constraints nullable="false"/>
</column>
2016-07-07 14:35:35 +00:00
<column name="STORAGE_PROVIDER_ID" type="VARCHAR(36)"/>
2016-06-30 20:47:49 +00:00
</createTable>
2016-08-01 15:18:58 +00:00
<createTable tableName="COMPONENT_CONFIG">
<column name="ID" type="VARCHAR(36)">
<constraints nullable="false"/>
</column>
<column name="COMPONENT_ID" type="VARCHAR(36)">
2016-07-07 14:35:35 +00:00
<constraints nullable="false"/>
</column>
<column name="NAME" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
2016-08-02 14:41:52 +00:00
<column name="VALUE" type="VARCHAR(4000)"/>
2016-07-07 14:35:35 +00:00
</createTable>
2016-08-01 15:18:58 +00:00
<createTable tableName="COMPONENT">
2016-07-07 14:35:35 +00:00
<column name="ID" type="VARCHAR(36)">
<constraints nullable="false"/>
</column>
2016-08-01 15:18:58 +00:00
<column name="NAME" type="VARCHAR(255)"/>
<column name="PARENT_ID" type="VARCHAR(36)"/>
<column name="PROVIDER_ID" type="VARCHAR(36)"/>
<column name="PROVIDER_TYPE" type="VARCHAR(255)"/>
2016-07-07 14:35:35 +00:00
<column name="REALM_ID" type="VARCHAR(36)"/>
</createTable>
2016-06-30 20:47:49 +00:00
2016-07-07 14:35:35 +00:00
<addPrimaryKey columnNames="IDENTITY_PROVIDER, USER_ID" constraintName="CONSTR_BROKER_LINK_PK" tableName="BROKER_LINK" />
<addPrimaryKey columnNames="ID" constraintName="CONSTR_FED_USER_ATTR_PK" tableName="FED_USER_ATTRIBUTE"/>
<addPrimaryKey columnNames="ID" constraintName="CONSTR_FED_USER_CONSENT_PK" tableName="FED_USER_CONSENT"/>
<addPrimaryKey columnNames="USER_CONSENT_ID, ROLE_ID" constraintName="CONSTR_USER_CONSENT_ROLE_PK" tableName="FED_USER_CONSENT_ROLE"/>
2016-08-01 10:31:16 +00:00
<addPrimaryKey columnNames="USER_CONSENT_ID, PROTOCOL_MAPPER_ID" constraintName="CONSTR_USER_CONSENT_PROTM_PK" tableName="FED_USER_CONSENT_PROT_MAPPER"/>
2016-07-07 14:35:35 +00:00
<!--
<addForeignKeyConstraint baseColumnNames="USER_CONSENT_ID" baseTableName="FED_USER_CONSENT_ROLE" constraintName="FK_FED_GRNTCSNT_ROLE_GR" referencedColumnNames="ID" referencedTableName="FED_USER_CONSENT"/>
<addForeignKeyConstraint baseColumnNames="USER_CONSENT_ID" baseTableName="FED_USER_CONSENT_PROT_MAPPER" constraintName="FK_FED_GRNTCSNT_PRM_GR" referencedColumnNames="ID" referencedTableName="FED_USER_CONSENT"/>
-->
<addPrimaryKey columnNames="ID" constraintName="CONSTR_FED_USER_CRED_PK" tableName="FED_USER_CREDENTIAL"/>
<addPrimaryKey columnNames="GROUP_ID, USER_ID" constraintName="CONSTR_FED_USER_GROUP" tableName="FED_USER_GROUP_MEMBERSHIP"/>
<addPrimaryKey columnNames="ROLE_ID, USER_ID" constraintName="CONSTR_FED_USER_ROLE" tableName="FED_USER_ROLE_MAPPING"/>
<addPrimaryKey columnNames="REQUIRED_ACTION, USER_ID" constraintName="CONSTR_FED_REQUIRED_ACTION" tableName="FED_USER_REQUIRED_ACTION"/>
2016-06-30 20:47:49 +00:00
2016-08-01 15:18:58 +00:00
<addPrimaryKey columnNames="ID" constraintName="CONSTR_COMPONENT_PK" tableName="COMPONENT"/>
<addPrimaryKey columnNames="ID" constraintName="CONSTR_COMPONENT_CONFIG_PK" tableName="COMPONENT_CONFIG"/>
<addForeignKeyConstraint baseColumnNames="REALM_ID" baseTableName="COMPONENT" constraintName="FK_COMPONENT_REALM" referencedColumnNames="ID" referencedTableName="REALM"/>
<addForeignKeyConstraint baseColumnNames="COMPONENT_ID" baseTableName="COMPONENT_CONFIG" constraintName="FK_COMPONENT_CONFIG" referencedColumnNames="ID" referencedTableName="COMPONENT"/>
2016-06-30 20:47:49 +00:00
</changeSet>
</databaseChangeLog>