Skip to content

Instantly share code, notes, and snippets.

@ivanursul
Created January 4, 2015 09:45
Show Gist options
  • Select an option

  • Save ivanursul/d3fca83fbe8c35efb11d to your computer and use it in GitHub Desktop.

Select an option

Save ivanursul/d3fca83fbe8c35efb11d to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.6"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.6
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.6.xsd">
<changeSet id="creating_tableA" author="ivanursul">
<createTable tableName="tableA">
<column name="id" type="bigint">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="tableB_id" type="bigint"/>
</createTable>
<addForeignKeyConstraint baseColumnNames="tableB_id" baseTableName="tableA" constraintName="fk_tableB_id"
referencedColumnNames="id" referencedTableName="tableB"
.../>
</changeSet>
<changeSet id="creating_tableB" author="ivanursul">
<createTable tableName="tableB">
<column name="id" type="bigint">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="tableA_id" type="bigint"/>
</createTable>
<addForeignKeyConstraint baseColumnNames="tableA_id" baseTableName="tableB" constraintName="fk_tableA_id"
referencedColumnNames="id" referencedTableName="tableA"
.../>
</changeSet>
</databaseChangeLog>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment