ng-tracker/src/main/resources/db/changelog-20180301_140000-schema.xml

56 lines
2.7 KiB
XML
Raw Normal View History

2018-05-04 17:08:19 +04:00
<?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="user" id="20180301140000-1" objectQuotingStrategy="QUOTE_ALL_OBJECTS">
<createTable tableName="users">
<column name="id" type="BIGINT">
<constraints nullable="false"/>
</column>
<column name="version" type="INTEGER"/>
<column name="login" type="VARCHAR(50)">
<constraints nullable="false" unique="true"/>
</column>
<column name="password_hash" type="VARCHAR(60)">
<constraints nullable="false"/>
</column>
<column name="first_name" type="VARCHAR(50)">
<constraints nullable="false"/>
</column>
<column name="last_name" type="VARCHAR(50)">
<constraints nullable="false"/>
</column>
<column name="email" type="VARCHAR(100)">
<constraints nullable="false" unique="true"/>
</column>
<column name="activated" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column name="activation_key" type="VARCHAR(20)"/>
<column name="reset_key" type="VARCHAR(20)"/>
<column name="reset_date" type="VARBINARY"/>
</createTable>
<addPrimaryKey columnNames="id" constraintName="users_pkey" tableName="users"/>
</changeSet>
<changeSet author="user" id="20180301140000-2" objectQuotingStrategy="QUOTE_ALL_OBJECTS">
<createTable tableName="user_roles">
<column name="name" type="VARCHAR(50)">
<constraints nullable="false"/>
</column>
</createTable>
<addPrimaryKey columnNames="name" constraintName="user_roles_pkey" tableName="user_roles"/>
</changeSet>
<changeSet author="user" id="20180301140000-3" objectQuotingStrategy="QUOTE_ALL_OBJECTS">
<createTable tableName="user_role">
<column name="user_id" type="BIGINT">
<constraints nullable="false"/>
</column>
<column name="user_role_name" type="VARCHAR(50)">
<constraints nullable="false"/>
</column>
</createTable>
<addPrimaryKey columnNames="user_id, user_role_name" constraintName="user_role_pkey"
tableName="user_role"/>
</changeSet>
</databaseChangeLog>