<?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 TBAddress.
    -->
    <changeSet id="20200806074959-2" author="jhipster">

        <addForeignKeyConstraint baseColumnNames="tb_country_id"
                                 baseTableName="tb_address"
                                 constraintName="fk_tb_address_tb_country_id"
                                 referencedColumnNames="id"
                                 referencedTableName="tb_country"/>

        <addForeignKeyConstraint baseColumnNames="tb_city_id"
                                 baseTableName="tb_address"
                                 constraintName="fk_tb_address_tb_city_id"
                                 referencedColumnNames="id"
                                 referencedTableName="tb_city"/>

        <addForeignKeyConstraint baseColumnNames="tb_district_id"
                                 baseTableName="tb_address"
                                 constraintName="fk_tb_address_tb_district_id"
                                 referencedColumnNames="id"
                                 referencedTableName="tb_district"/>

        <addForeignKeyConstraint baseColumnNames="tb_ward_id"
                                 baseTableName="tb_address"
                                 constraintName="fk_tb_address_tb_ward_id"
                                 referencedColumnNames="id"
                                 referencedTableName="tb_ward"/>

    </changeSet>
</databaseChangeLog>
