<?xml version="1.0" encoding="utf-8"?>
<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.5.xsd">
    <!--
        Added the constraints for entity TBDetailUser.
    -->
    <changeSet id="20200806074957-2" author="jhipster">

        <addForeignKeyConstraint baseColumnNames="user_id"
                                 baseTableName="tb_detail_user"
                                 constraintName="fk_tb_detail_user_user_id"
                                 referencedColumnNames="id"
                                 referencedTableName="jhi_user"/>

        <addForeignKeyConstraint baseColumnNames="tb_role_id"
                                 baseTableName="tb_detail_user"
                                 constraintName="fk_tb_detail_user_tb_role_id"
                                 referencedColumnNames="id"
                                 referencedTableName="tb_role"/>

        <addForeignKeyConstraint baseColumnNames="tb_customer_id"
                                 baseTableName="tb_detail_user"
                                 constraintName="fk_tb_detail_user_tb_customer_id"
                                 referencedColumnNames="id"
                                 referencedTableName="tb_customer"/>

        <addForeignKeyConstraint baseColumnNames="tb_address_id"
                                 baseTableName="tb_detail_user"
                                 constraintName="fk_tb_detail_user_tb_address_id"
                                 referencedColumnNames="id"
                                 referencedTableName="tb_address"/>


    </changeSet>
</databaseChangeLog>
