36 lines
1.7 KiB
XML
36 lines
1.7 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<databaseChangeLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
|
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd"
|
|
>
|
|
<changeSet id="create-user-role-table" author="Jeffrey Duroyon">
|
|
<createTable tableName="user_role" schemaName="${schemaName}">
|
|
<column name="id" type="uuid" defaultValueComputed="gen_random_uuid()">
|
|
<constraints primaryKey="true" nullable="false"/>
|
|
</column>
|
|
<column name="user_id" type="uuid">
|
|
<constraints nullable="false" foreignKeyName="fk_user_role_box_user" references="${schemaName}.user(id)"/>
|
|
</column>
|
|
<column name="role_id" type="uuid">
|
|
<constraints nullable="false" foreignKeyName="fk_user_role_box_role" references="${schemaName}.role(id)"/>
|
|
</column>
|
|
<column name="creation_date" type="timestamp" defaultValueComputed="now()">
|
|
<constraints nullable="true"/>
|
|
</column>
|
|
<column name="last_update_date" type="timestamp">
|
|
<constraints nullable="true"/>
|
|
</column>
|
|
<column name="last_update_user" type="varchar(100)">
|
|
</column>
|
|
<column name="creation_user" type="varchar(100)">
|
|
</column>
|
|
</createTable>
|
|
<addUniqueConstraint
|
|
columnNames="role_id, user_id"
|
|
constraintName="unique_user_role"
|
|
schemaName="${schemaName}"
|
|
tableName="user_role"
|
|
/>
|
|
</changeSet>
|
|
</databaseChangeLog> |