Create table: app group org unit entry
columnName="user_agent"
newDataType="${user-agent.type}"/>
</changeSet>
+
+
+ <!-- 4228: Create table - app group org unit table-->
+ <changeSet id="20190725-4228-1"
+ author="woodjes">
+ <comment>4228: Create table - app group org unit</comment>
+ <createTable tableName="application_group_ou_entry">
+ <column name="group_id"
+ type="${id.type}">
+ <constraints nullable="false"/>
+ </column>
+ <column name="org_unit_id"
+ type="${id.type}">
+ <constraints nullable="false"/>
+ </column>
+ </createTable>
+ </changeSet>
+
+ <changeSet author="woodjes"
+ id="20190725-4228-2">
+ <addPrimaryKey columnNames="group_id, org_unit_id"
+ constraintName="app_group_ou_entry_pkey"
+ tableName="application_group_ou_entry"/>
+ </changeSet>
+
+ <changeSet id="20190725-4228-3"
+ author="woodjes">
+ <addForeignKeyConstraint baseColumnNames="group_id"
+ baseTableName="application_group_ou_entry"
+ constraintName="app_grp_ou_entry_grp_id_fkey"
+ onDelete="CASCADE"
+ referencedColumnNames="id"
+ referencedTableName="application_group"/>
+ </changeSet>
</databaseChangeLog>
