Files
budget-backend/liquibase/changelogs/changeset/create-expenses.xml

35 lines
1.5 KiB
XML

<?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-expenses-table" author="kratisto">
<createTable tableName="expense">
<column name="id" type="uuid" defaultValueComputed="gen_random_uuid()">
<constraints nullable="false" unique="true"/>
</column>
<column name="account_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_expense" type="char(1)">
<constraints nullable="false"/>
</column>
<column name="expense_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>