assets sample data

This commit is contained in:
Michael Hoennig 2019-05-02 11:25:13 +02:00
parent 84f1abf0b0
commit 13100a9010
3 changed files with 45 additions and 0 deletions

View File

@ -23,5 +23,6 @@
<include file="config/liquibase/sample-data/customers.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/sample-data/customers.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/sample-data/memberships.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/sample-data/memberships.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/sample-data/shares.xml" relativeToChangelogFile="false"/> <include file="config/liquibase/sample-data/shares.xml" relativeToChangelogFile="false"/>
<include file="config/liquibase/sample-data/assets.xml" relativeToChangelogFile="false"/>
</databaseChangeLog> </databaseChangeLog>

View File

@ -0,0 +1,13 @@
id;membership_id;document_date;value_date;action;amount;remark
1;1;2001-05-10;2001-05-11;PAYMENT;1024;some|multiline|remark
2;1;2007-09-09;2008-07-10;PAYBACK;1024;another remark
3;2;2017-02-15;2017-02-15;PAYMENT;512;became a member again
4;2;2017-02-15;2017-02-15;PAYMENT;64;just writing something
5;3;2003-06-11;2003-06-11;PAYMENT;256;some comment
6;3;2003-06-15;2004-07-03;PAYBACK;256;cancelled membership
7;4;2017-06-15;2017-05-17;PAYMENT;1024;
8;5;2011-09-18;2011-09-01;PAYMENT;640;
9;5;2013-01-15;2013-01-01;PAYMENT;1280;signed more shares
10;5;2017-12-22;2018-07-01;PAYBACK;1600;cancelled most of their shares
1 id membership_id document_date value_date action amount remark
2 1 1 2001-05-10 2001-05-11 PAYMENT 1024 some|multiline|remark
3 2 1 2007-09-09 2008-07-10 PAYBACK 1024 another remark
4 3 2 2017-02-15 2017-02-15 PAYMENT 512 became a member again
5 4 2 2017-02-15 2017-02-15 PAYMENT 64 just writing something
6 5 3 2003-06-11 2003-06-11 PAYMENT 256 some comment
7 6 3 2003-06-15 2004-07-03 PAYBACK 256 cancelled membership
8 7 4 2017-06-15 2017-05-17 PAYMENT 1024
9 8 5 2011-09-18 2011-09-01 PAYMENT 640
10 9 5 2013-01-15 2013-01-01 PAYMENT 1280 signed more shares
11 10 5 2017-12-22 2018-07-01 PAYBACK 1600 cancelled most of their shares

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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.5.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<property name="now" value="now()" dbms="h2"/>
<property name="now" value="current_timestamp" dbms="postgresql"/>
<property name="floatType" value="float4" dbms="postgresql, h2"/>
<property name="floatType" value="float" dbms="mysql, oracle, mssql"/>
<changeSet id="20190502111400-1" author="mhoennig" context="sample-data">
<loadData encoding="UTF-8"
file="config/liquibase/sample-data/assets.csv"
separator=";"
tableName="asset">
</loadData>
</changeSet>
<changeSet id="20190502111400-2" author="mhoennig" context="sample-data">
<sql>
UPDATE asset SET remark = replace(remark, '|', '\n')
</sql>
<rollback>
DELETE FROM asset;
</rollback>
</changeSet>
</databaseChangeLog>