wip
This commit is contained in:
@@ -5,9 +5,7 @@
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
|
||||
<include file="prepare-database.sql" relativeToChangelogFile="true"/>
|
||||
<include file="changeset/create-user.xml" relativeToChangelogFile="true"/>
|
||||
<include file="changeset/create-account.xml" relativeToChangelogFile="true"/>
|
||||
<include file="changeset/create-shared-account.xml" relativeToChangelogFile="true"/>
|
||||
<include file="changeset/create-budget.xml" relativeToChangelogFile="true"/>
|
||||
<include file="changeset/create-category.xml" relativeToChangelogFile="true"/>
|
||||
<include file="changeset/create-expenses.xml" relativeToChangelogFile="true"/>
|
||||
<include file="changeset/create-jointaccount.xml" relativeToChangelogFile="true"/>
|
||||
<include file="changeset/create-jointexpenses.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
|
||||
@@ -3,18 +3,21 @@
|
||||
<databaseChangeLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
|
||||
<changeSet id="add-jointaccount-table" author="kratisto">
|
||||
<createTable tableName="jointaccount">
|
||||
<changeSet id="add-budget-table" author="kratisto">
|
||||
<createTable tableName="budget">
|
||||
<column name="id" type="uuid" defaultValueComputed="gen_random_uuid()">
|
||||
<constraints nullable="false" unique="true"/>
|
||||
</column>
|
||||
<column name="name" type="text" >
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
<column name="provider" type="text">
|
||||
<constraints nullable="true"/>
|
||||
<column name="closed" type="boolean" defaultValueComputed="false">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="user_id" type="uuid" >
|
||||
<column name="duration_start" type="text" >
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="duration_end" type="text" >
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="created_at" type="timestamp" defaultValueComputed="now()">
|
||||
@@ -3,20 +3,17 @@
|
||||
<databaseChangeLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
|
||||
<changeSet id="add-account-table" author="kratisto">
|
||||
<createTable tableName="account">
|
||||
<changeSet id="add-category-table" author="kratisto">
|
||||
<createTable tableName="category">
|
||||
<column name="id" type="uuid" defaultValueComputed="gen_random_uuid()">
|
||||
<constraints nullable="false" unique="true"/>
|
||||
</column>
|
||||
<column name="name" type="text" >
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
<column name="provider" type="text">
|
||||
<column name="budget" type="double" >
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
<column name="user_id" type="uuid" >
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="created_at" type="timestamp" defaultValueComputed="now()">
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
@@ -8,7 +8,7 @@
|
||||
<column name="id" type="uuid" defaultValueComputed="gen_random_uuid()">
|
||||
<constraints nullable="false" unique="true"/>
|
||||
</column>
|
||||
<column name="account_id" type="uuid">
|
||||
<column name="category_id" type="uuid">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="libelle" type="text" >
|
||||
@@ -17,9 +17,6 @@
|
||||
<column name="value" type="number">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="type_expense" type="char(1)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="expense_date" type="timestamp" defaultValueComputed="now()">
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<databaseChangeLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
|
||||
<changeSet id="add-jointexpenses-table" author="kratisto">
|
||||
<createTable tableName="jointexpense">
|
||||
<column name="id" type="uuid" defaultValueComputed="gen_random_uuid()">
|
||||
<constraints nullable="false" unique="true"/>
|
||||
</column>
|
||||
<column name="jointaccount_id" type="uuid">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="libelle" type="text" >
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
<column name="value" type="number">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="type_jointexpense" type="char(1)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="jointexpense_date" type="timestamp" defaultValueComputed="now()">
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
<column name="created_at" type="timestamp" defaultValueComputed="now()">
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
<column name="updated_at" type="timestamp">
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
</createTable>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<databaseChangeLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
|
||||
<changeSet id="add-shared-account-table" author="kratisto">
|
||||
<createTable tableName="shared_account">
|
||||
<column name="id" type="uuid" defaultValueComputed="gen_random_uuid()">
|
||||
<constraints nullable="false" unique="true"/>
|
||||
</column>
|
||||
<column name="shared_account" type="uuid">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="created_at" type="timestamp">
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
<column name="user_id" type="uuid" >
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
</createTable>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
@@ -20,6 +20,9 @@
|
||||
<column name="email" type="text">
|
||||
<constraints nullable="false" unique="true"/>
|
||||
</column>
|
||||
<column name="nickname" type="text">
|
||||
<constraints nullable="false" unique="true"/>
|
||||
</column>
|
||||
</createTable>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
url=jdbc:postgresql://database:5432/nos_comptes
|
||||
url=jdbc:postgresql://database:5432/budget
|
||||
username=postgres
|
||||
password=password
|
||||
changeLogFile=changelog-master.xml
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
CREATE SCHEMA IF NOT EXISTS nos_comptes;
|
||||
CREATE SCHEMA IF NOT EXISTS budget;
|
||||
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
|
||||
Reference in New Issue
Block a user