KEYCLOAK-9053 KEYCLOAK-9818 Increase column size for federated foreign keys

This commit is contained in:
vramik 2020-01-20 10:11:42 +01:00 committed by Hynek Mlnařík
parent 1989483401
commit a83467047b

View file

@ -25,4 +25,43 @@
</addColumn>
</changeSet>
<changeSet author="keycloak" id="9.0.0-drop-constraints-for-column-increase">
<preConditions onFail="MARK_RAN" onSqlOutput="TEST">
<dbms type="mssql"/>
</preConditions>
<dropUniqueConstraint tableName="RESOURCE_SERVER_PERM_TICKET" constraintName="UK_FRSR6T700S9V50BU18WS5PMT"/>
<dropUniqueConstraint tableName="RESOURCE_SERVER_RESOURCE" constraintName="UK_FRSR6T700S9V50BU18WS5HA6"/>
<dropPrimaryKey tableName="OFFLINE_CLIENT_SESSION" constraintName="CONSTRAINT_OFFL_CL_SES_PK3"/>
</changeSet>
<changeSet author="keycloak" id="9.0.0-increase-column-size-federated-fk">
<modifyDataType newDataType="VARCHAR(255)" tableName="FED_USER_CONSENT" columnName="CLIENT_ID"/>
<modifyDataType newDataType="VARCHAR(255)" tableName="KEYCLOAK_ROLE" columnName="CLIENT_REALM_CONSTRAINT"/>
<modifyDataType newDataType="VARCHAR(255)" tableName="RESOURCE_SERVER_POLICY" columnName="OWNER"/>
<modifyDataType newDataType="VARCHAR(255)" tableName="USER_CONSENT" columnName="CLIENT_ID"/>
<modifyDataType newDataType="VARCHAR(255)" tableName="USER_ENTITY" columnName="SERVICE_ACCOUNT_CLIENT_LINK"/>
<modifyDataType newDataType="VARCHAR(255)" tableName="OFFLINE_CLIENT_SESSION" columnName="CLIENT_ID"/>
<modifyDataType newDataType="VARCHAR(255)" tableName="RESOURCE_SERVER_PERM_TICKET" columnName="OWNER"/>
<modifyDataType newDataType="VARCHAR(255)" tableName="RESOURCE_SERVER_PERM_TICKET" columnName="REQUESTER"/>
<modifyDataType newDataType="VARCHAR(255)" tableName="RESOURCE_SERVER_RESOURCE" columnName="OWNER"/>
</changeSet>
<changeSet author="keycloak" id="9.0.0-recreate-constraints-after-column-increase">
<preConditions onFail="MARK_RAN" onSqlOutput="TEST">
<dbms type="mssql"/>
</preConditions>
<addNotNullConstraint columnDataType="VARCHAR(255)" tableName="OFFLINE_CLIENT_SESSION" columnName="CLIENT_ID" />
<addNotNullConstraint columnDataType="VARCHAR(255)" tableName="RESOURCE_SERVER_PERM_TICKET" columnName="OWNER" />
<addNotNullConstraint columnDataType="VARCHAR(255)" tableName="RESOURCE_SERVER_PERM_TICKET" columnName="REQUESTER" />
<addNotNullConstraint columnDataType="VARCHAR(255)" tableName="RESOURCE_SERVER_RESOURCE" columnName="OWNER" />
<addUniqueConstraint tableName="RESOURCE_SERVER_PERM_TICKET" columnNames="OWNER, REQUESTER, RESOURCE_SERVER_ID, RESOURCE_ID, SCOPE_ID" constraintName="UK_FRSR6T700S9V50BU18WS5PMT"/>
<addUniqueConstraint tableName="RESOURCE_SERVER_RESOURCE" columnNames="NAME, OWNER, RESOURCE_SERVER_ID" constraintName="UK_FRSR6T700S9V50BU18WS5HA6"/>
<addPrimaryKey columnNames="USER_SESSION_ID, CLIENT_ID, CLIENT_STORAGE_PROVIDER, EXTERNAL_CLIENT_ID, OFFLINE_FLAG" constraintName="CONSTRAINT_OFFL_CL_SES_PK3" tableName="OFFLINE_CLIENT_SESSION"/>
</changeSet>
</databaseChangeLog>