File: example.dbm

package info (click to toggle)
pgmodeler 1.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,160 kB
  • sloc: cpp: 99,216; xml: 27; sh: 15; makefile: 6
file content (230 lines) | stat: -rw-r--r-- 8,265 bytes parent folder | download | duplicates (2)
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<?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" author="Raphael Araújo e Silva" max-obj-count="6"
	 last-position="0,0" last-zoom="1.05" scene-rect="0,0,1570.8,1076.8"
	 layers="Default layer"
	 active-layers="0"
	 layer-name-colors="#000000"
	 layer-rect-colors="#1b81b4"
	 show-layer-names="false" show-layer-rects="false">
<role name="roletest"
 inherit="true">
</role>

<database name="exampledb" encoding="UTF8" is-template="false" allow-conns="true">
	<comment> <![CDATA[Example Database Model]]> </comment>
</database>

<schema name="public" layers="0" protected="true" fill-color="#000000" name-color="#000000" sql-disabled="true">
</schema>

<tag name="sample tag">
	<style id="table-body" colors="#ffffff,#ffffff,#000000"/>
	<style id="table-ext-body" colors="#ffffff,#ffffff,#000000"/>
	<style id="table-name" colors="#ffffff"/>
	<style id="table-schema-name" colors="#ffffff"/>
	<style id="table-title" colors="#ff0000,#800000,#000000"/>
	<style id="table-toggler-body" colors="#ffffff,#ffffff,#000000"/>
	<style id="table-toggler-btns" colors="#fcfcfc,#fcfcfc,#808080"/>
	<comment> <![CDATA[this tag is a test]]> </comment>
</tag>
	<language name="testlang"/>
<function name="trigger_func"
		window-func="false"
		returns-setof="false"
		behavior-type="CALLED ON NULL INPUT"
		function-type="IMMUTABLE"
		security-type="SECURITY DEFINER"
		parallel-type="PARALLEL UNSAFE"
		execution-cost="20"
		row-amount="2500">
	<schema name="public"/>
	<language name="testlang"/>
	<return-type>
	<type name="trigger" length="0"/>
	</return-type>
	<definition> <![CDATA[SELECT 1+1;]]> </definition>
</function>

<table name="table" layers="0" collapse-mode="2" max-obj-count="4" z-value="0">
	<schema name="public"/>
	<tag name="sample tag"/>
	<position x="40" y="40"/>
	<column name="column" not-null="true">
		<type name="serial" length="1"/>
	</column>
	<column name="column1">
		<type name="text" length="1"/>
	</column>
	<constraint name="table_pk" type="pk-constr" factor="10" table="public.&quot;table&quot;">
		<columns names="column" ref-type="src-columns"/>
	</constraint>
	<constraint name="table_uq" type="uq-constr" factor="10" table="public.&quot;table&quot;">
		<columns names="column1" ref-type="src-columns"/>
	</constraint>
	<constraint name="table_ck" type="ck-constr" table="public.&quot;table&quot;">
			<expression> <![CDATA[ column1 > 0 ]]> </expression>
	</constraint>
</table>

<index name="index" table="public.&quot;table&quot;"
	 concurrent="true" unique="true" fast-update="false" buffering="false" nulls-not-distinct="false"
	 index-type="hash" factor="0">
		<idxelement use-sorting="false">
			<column name="column1"/>
		</idxelement>
</index>

<table name="table1" layers="0" protected="true" collapse-mode="2" max-obj-count="4" z-value="0">
	<schema name="public"/>
	<position x="680" y="560"/>
	<column name="column" not-null="true" protected="true">
		<type name="serial" length="1"/>
	</column>
	<column name="column1" protected="true">
		<type name="text" length="1"/>
	</column>
	<column name="column2" not-null="true" protected="true">
		<type name="integer" length="1"/>
	</column>
	<column name="column3" protected="true">
		<type name="text" length="1"/>
	</column>
	<constraint name="table_pk" type="pk-constr" factor="10" protected="true" table="public.table1">
		<columns names="column" ref-type="src-columns"/>
	</constraint>
	<constraint name="table_uq" type="uq-constr" factor="10" protected="true" table="public.table1">
		<columns names="column1" ref-type="src-columns"/>
	</constraint>
	<constraint name="table_ck" type="ck-constr" protected="true" table="public.table1">
			<expression> <![CDATA[ column1 > 0 ]]> </expression>
	</constraint>
</table>

<rule name="rule1" event-type="ON INSERT" exec-type="ALSO"
 protected="true" table="public.table1">
		<condition> <![CDATA[column1 = 0]]> </condition>
		<commands> <![CDATA[UPDATE public.table1 SET column1 = 1]]> </commands>
</rule>

<trigger name="trigger1" firing-type="BEFORE" per-line="false" constraint="false"
	 ins-event="true" del-event="true" upd-event="true" trunc-event="false" protected="true"
	 table="public.table1">
		<function signature="public.trigger_func()"/>
</trigger>

<relationship name="table1_has_many_table" type="rel1n" layers="0"
	 src-col-pattern="{sc}_{st}"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 src-table="public.table1"
	 dst-table="public.&quot;table&quot;"
	 src-required="false" dst-required="false">
	<label ref-type="name-label">
		<position x="164.369" y="161.148"/>
	</label>
	<column name="attribute">
		<type name="integer" length="1"/>
	</column>
</relationship>

<view name="view" layers="0" collapse-mode="2" max-obj-count="3" z-value="0">
	<schema name="public"/>
	<position x="40" y="600"/>
	<reference object="public.&quot;table&quot;.column1" type="column" ref-name="c1" ref-alias="col1" use-columns="true"/>
	<reference object="public.table1.column2" type="column" ref-name="c2" ref-alias="col2" use-columns="true"/>
	<reference object="public.table1" type="table" ref-name="t3" use-columns="true"/>
	<definition> <![CDATA[ select 1+1 ]]> </definition>
</view>

<relationship name="rel_view_table" type="reltv" layers="0"
	 src-table="public.view"
	 dst-table="public.&quot;table&quot;"
	 src-required="false" dst-required="false"/>

<relationship name="rel_view_table1" type="reltv" layers="0"
	 src-table="public.view"
	 dst-table="public.table1"
	 src-required="false" dst-required="false">
	<label ref-type="name-label">
		<position x="9.79871" y="6.45926"/>
	</label>
</relationship>

<textbox name="textbox1" layers="0" protected="true" z-value="0" width="102.406" font-size="9">
	<position x="260" y="420"/>
	<comment> <![CDATA[Protected Textbox]]> </comment>
</textbox>

<table name="table2" layers="0" oids="true" collapse-mode="2" max-obj-count="4" z-value="0">
	<schema name="public"/>
	<position x="680" y="40"/>
	<column name="column" not-null="true">
		<type name="serial" length="1"/>
	</column>
	<column name="column1">
		<type name="text" length="1"/>
	</column>
	<column name="column2" not-null="true">
		<type name="integer" length="1"/>
	</column>
	<column name="column3">
		<type name="text" length="1"/>
	</column>
	<constraint name="table_pk" type="pk-constr" factor="10" table="public.table2">
		<columns names="column" ref-type="src-columns"/>
	</constraint>
	<constraint name="table_uq" type="uq-constr" factor="10" table="public.table2">
		<columns names="column1" ref-type="src-columns"/>
	</constraint>
	<constraint name="table_ck" type="ck-constr" table="public.table2">
			<expression> <![CDATA[ column1 > 0 ]]> </expression>
	</constraint>
</table>

<index name="index" table="public.table2"
	 concurrent="true" unique="true" fast-update="false" buffering="false" nulls-not-distinct="false"
	 index-type="hash" factor="0">
		<idxelement use-sorting="false">
			<column name="column1"/>
		</idxelement>
</index>

<foreigndatawrapper name="fdw_test">
	<role name="roletest"/>
</foreigndatawrapper>

<foreignserver name="server_test">
	<role name="roletest"/>
	<foreigndatawrapper name="fdw_test"/>
</foreignserver>

<foreigntable name="foreign_table" layers="0" gen-alter-cmds="true" collapse-mode="2" max-obj-count="1" z-value="0">
	<schema name="public"/>
	<role name="roletest"/>
	<foreignserver name="server_test"/>
	<position x="680" y="400"/>
	<column name="id" not-null="true">
		<type name="smallint" length="0"/>
	</column>
</foreigntable>

<constraint name="table2_fk" type="fk-constr" comparison-type="MATCH FULL"
	 upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.&quot;table&quot;" table="public.table2">
	<columns names="column2" ref-type="src-columns"/>
	<columns names="column" ref-type="dst-columns"/>
</constraint>

<relationship name="rel_table2_table" type="relfk" layers="0"
	 src-table="public.table2"
	 dst-table="public.&quot;table&quot;" reference-fk="table2_fk"
	 src-required="false" dst-required="false">
	<label ref-type="name-label">
		<position x="30.9966" y="-84.4807"/>
	</label>
</relationship>

</dbmodel>