Merge branch '56-creating-tables-in-DB' into 'dev'

Resolve "Создание таблиц в БД по модулю конференций"

Closes #56

See merge request romanov73/ng-tracker!40
This commit is contained in:
Anton Romanov 2019-04-01 05:27:43 +00:00
commit 61d4c67aac
2 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,57 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<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.1.xsd">
<changeSet author="vova" id="20190331_000010-1">
<createTable tableName="conference">
<column name="id" type="integer">
<constraints nullable="false"/>
</column>
<column name="title" type="varchar(300)"/>
<column name="description" type="varchar(500)"/>
<column name="url" type="varchar(255)"/>
<column name="ping" type="integer"/>
<column name="begin_date" type="timestamp"/>
<column name="end_date" type="timestamp"/>
</createTable>
<addPrimaryKey columnNames="id" constraintName="pk_conference" tableName="conference"/>
</changeSet>
<changeSet author="vova" id="20190331_000010-2">
<createTable tableName="paper_conference">
<column name="conference_id" type="integer"/>
<column name="paper_id" type="integer"/>
</createTable>
<addForeignKeyConstraint baseTableName="paper_conference" baseColumnNames="conference_id"
constraintName=" fk_paper_conference_conference" referencedTableName="conference"
referencedColumnNames="id"/>
<addForeignKeyConstraint baseTableName="paper_conference" baseColumnNames="paper_id"
constraintName="fk_paper_conference_paper" referencedTableName="paper"
referencedColumnNames="id"/>
</changeSet>
<changeSet author="vova" id="20190331_000010-3">
<createTable tableName="users_conference">
<column name="conference_id" type="integer"/>
<column name="users_id" type="integer"/>
<column name="participation" type="boolean"/>
<column name="deposit" type="varchar(255)"/>
</createTable>
<addForeignKeyConstraint baseTableName="users_conference" baseColumnNames="conference_id"
constraintName=" fk_users_conference_conference" referencedTableName="conference"
referencedColumnNames="id"/>
<addForeignKeyConstraint baseTableName="users_conference" baseColumnNames="users_id"
constraintName="fk_users_conference_users" referencedTableName="users"
referencedColumnNames="id"/>
</changeSet>
<changeSet author="vova" id="20190331_000010-4">
<addColumn tableName="deadline">
<column name="conference_id" type="integer"/>
</addColumn>
<addForeignKeyConstraint baseTableName="deadline" baseColumnNames="conference_id"
constraintName=" fk_deadlines_conference" referencedTableName="conference"
referencedColumnNames="id"/>
</changeSet>
</databaseChangeLog>

View File

@ -21,5 +21,6 @@
<include file="db/changelog-20190318_000000-schema.xml"/>
<include file="db/changelog-20190318_000001-schema.xml"/>
<include file="db/changelog-20190327_000000-schema.xml"/>
<include file="db/changelog-20190331_000010-schema.xml"/>
<include file="db/common/changelog-20190312_130000-schema.xml"/>
</databaseChangeLog>