-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema-v1.dbm
99 lines (90 loc) · 3.24 KB
/
schema-v1.dbm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?xml version="1.0" encoding="UTF-8"?>
<!--
CAUTION: Do not modify this file unless you know what you are doing.
Unexpected results may occur if the code is changed deliberately.
-->
<dbmodel pgmodeler-ver="1.1.0" use-changelog="false" max-obj-count="4"
last-position="0,0" last-zoom="1"
default-owner="postgres"
layers="Default layer"
active-layers="0"
layer-name-colors="#000000"
layer-rect-colors="#b4b4b4"
show-layer-names="false" show-layer-rects="false">
<database name="rinhabackend" encoding="UTF8" is-template="false" allow-conns="true">
</database>
<schema name="public" layers="0" fill-color="#e1e1e1" name-color="#000000" sql-disabled="true">
</schema>
<table name="account" layers="0" unlogged="true" collapse-mode="2" pagination="true" attribs-page="0" ext-attribs-page="0" max-obj-count="1" z-value="0">
<schema name="public"/>
<role name="postgres"/>
<position x="340" y="160"/>
<column name="id" not-null="true">
<type name="integer" length="0"/>
</column>
<constraint name="Account_pk" type="pk-constr" table="public.account">
<columns names="id" ref-type="src-columns"/>
</constraint>
</table>
<table name="transaction" layers="0" unlogged="true" collapse-mode="2" max-obj-count="4" z-value="0">
<schema name="public"/>
<role name="postgres"/>
<position x="160" y="400"/>
<column name="amount" not-null="true">
<type name="integer" length="0"/>
<comment> <![CDATA[Transaction amount]]> </comment>
</column>
<column name="description" not-null="true">
<type name="text" length="0"/>
</column>
<column name="created_on" not-null="true" default-value="CURRENT_TIMESTAMP">
<type name="timestamp" length="0"/>
</column>
<customidxs object-type="column">
<object name="account_id" index="3"/>
</customidxs>
<customidxs object-type="constraint">
<object name="account_fk" index="0"/>
</customidxs></table>
<relationship name="account_has_many_transaction" type="rel1n" layers="0"
src-col-pattern="{st}_{sc}"
pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
src-fk-pattern="{st}_fk"
custom-color="#8d5216"
src-table="public.account"
dst-table="public.transaction"
src-required="true" dst-required="false"
upd-action="CASCADE"
del-action="CASCADE">
<label ref-type="name-label">
<position x="48.3731" y="-25.453"/>
</label>
</relationship>
<index name="idx_t_user" table="public.transaction"
concurrent="false" unique="false" fast-update="false" buffering="false" nulls-not-distinct="false"
index-type="hash" factor="0">
<idxelement use-sorting="false">
<column name="account_id"/>
</idxelement>
</index>
<index name="idx_t_date" table="public.transaction"
concurrent="false" unique="false" fast-update="false" buffering="false" nulls-not-distinct="false"
index-type="btree" factor="0">
<idxelement use-sorting="false">
<column name="created_on"/>
</idxelement>
</index>
<view name="running_balance" layers="0" collapse-mode="2" max-obj-count="0" z-value="0">
<schema name="public"/>
<role name="postgres"/>
<position x="600" y="360"/>
<simplecol name="_expr0_" alias="_expr0_" type="text"/>
<definition> <![CDATA[SELECT
t.account_id AS account_id
, sum(t.amount) AS balance
FROM
transaction t
INNER JOIN public.account acc ON acc.id = t.account_id
account_id;;]]> </definition>
</view>
</dbmodel>