Skip to content

Commit b34ff27

Browse files
committed
ERD 추가
1 parent 93068a6 commit b34ff27

File tree

3 files changed

+1350
-0
lines changed

3 files changed

+1350
-0
lines changed

database/erd/myapp_erd.dbs

Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<project name="myapp" id="Project_32c557ba" template="Default" database="MySql" >
3+
<schema name="myapp" catalogname="myapp" >
4+
<table name="article_tag" >
5+
<column name="id" type="int" length="10" decimal="0" jt="4" mandatory="y" unsigned="y" autoincrement="y" />
6+
<column name="article_id" type="int" length="10" decimal="0" jt="4" mandatory="y" unsigned="y" />
7+
<column name="tag_id" type="int" length="10" decimal="0" jt="4" mandatory="y" unsigned="y" />
8+
<index name="pk_article_tag" unique="PRIMARY_KEY" >
9+
<column name="id" />
10+
</index>
11+
<index name="article_tag_article_id_foreign" unique="NORMAL" >
12+
<column name="article_id" />
13+
</index>
14+
<index name="article_tag_tag_id_foreign" unique="NORMAL" >
15+
<column name="tag_id" />
16+
</index>
17+
<fk name="article_tag_article_id_foreign" to_schema="myapp" to_table="articles" delete_action="cascade" >
18+
<fk_column name="article_id" pk="id" />
19+
</fk>
20+
<fk name="article_tag_tag_id_foreign" to_schema="myapp" to_table="tags" delete_action="cascade" >
21+
<fk_column name="tag_id" pk="id" />
22+
</fk>
23+
</table>
24+
<table name="articles" >
25+
<column name="id" type="int" length="10" decimal="0" jt="4" mandatory="y" unsigned="y" autoincrement="y" />
26+
<column name="user_id" type="int" length="10" decimal="0" jt="4" mandatory="y" unsigned="y" />
27+
<column name="title" type="varchar" length="255" decimal="0" jt="12" mandatory="y" />
28+
<column name="content" type="text" length="65535" decimal="0" jt="-1" mandatory="y" />
29+
<column name="created_at" type="timestamp" length="19" decimal="0" jt="93" />
30+
<column name="updated_at" type="timestamp" length="19" decimal="0" jt="93" />
31+
<column name="notification" type="bit" decimal="0" jt="-7" mandatory="y" >
32+
<defo>1</defo>
33+
</column>
34+
<column name="view_count" type="tinyint" length="3" decimal="0" jt="-6" mandatory="y" >
35+
<defo>0</defo>
36+
</column>
37+
<column name="deleted_at" type="timestamp" length="19" decimal="0" jt="93" />
38+
<index name="pk_articles" unique="PRIMARY_KEY" >
39+
<column name="id" />
40+
</index>
41+
<index name="articles_user_id_index" unique="NORMAL" >
42+
<column name="user_id" />
43+
</index>
44+
<index name="search" unique="NORMAL" >
45+
<column name="title" />
46+
<column name="content" />
47+
</index>
48+
<fk name="articles_user_id_foreign" to_schema="myapp" to_table="users" delete_action="cascade" update_action="cascade" >
49+
<fk_column name="user_id" pk="id" />
50+
</fk>
51+
</table>
52+
<table name="attachments" >
53+
<column name="id" type="int" length="10" decimal="0" jt="4" mandatory="y" unsigned="y" autoincrement="y" />
54+
<column name="article_id" type="int" length="10" decimal="0" jt="4" unsigned="y" />
55+
<column name="filename" type="varchar" length="255" decimal="0" jt="12" mandatory="y" />
56+
<column name="bytes" type="int" length="10" decimal="0" jt="4" unsigned="y" />
57+
<column name="mime" type="varchar" length="255" decimal="0" jt="12" />
58+
<column name="created_at" type="timestamp" length="19" decimal="0" jt="93" />
59+
<column name="updated_at" type="timestamp" length="19" decimal="0" jt="93" />
60+
<index name="pk_attachments" unique="PRIMARY_KEY" >
61+
<column name="id" />
62+
</index>
63+
<index name="attachments_article_id_index" unique="NORMAL" >
64+
<column name="article_id" />
65+
</index>
66+
</table>
67+
<table name="comments" >
68+
<column name="id" type="int" length="10" decimal="0" jt="4" mandatory="y" unsigned="y" autoincrement="y" />
69+
<column name="user_id" type="int" length="10" decimal="0" jt="4" mandatory="y" unsigned="y" />
70+
<column name="parent_id" type="int" length="10" decimal="0" jt="4" unsigned="y" />
71+
<column name="commentable_type" type="varchar" length="255" decimal="0" jt="12" mandatory="y" />
72+
<column name="commentable_id" type="int" length="10" decimal="0" jt="4" mandatory="y" unsigned="y" />
73+
<column name="content" type="text" length="65535" decimal="0" jt="-1" mandatory="y" />
74+
<column name="created_at" type="timestamp" length="19" decimal="0" jt="93" />
75+
<column name="updated_at" type="timestamp" length="19" decimal="0" jt="93" />
76+
<column name="deleted_at" type="timestamp" length="19" decimal="0" jt="93" />
77+
<index name="pk_comments" unique="PRIMARY_KEY" >
78+
<column name="id" />
79+
</index>
80+
<index name="comments_parent_id_foreign" unique="NORMAL" >
81+
<column name="parent_id" />
82+
</index>
83+
<index name="comments_user_id_index" unique="NORMAL" >
84+
<column name="user_id" />
85+
</index>
86+
<fk name="comments_parent_id_foreign" to_schema="myapp" to_table="comments" >
87+
<fk_column name="parent_id" pk="id" />
88+
</fk>
89+
<fk name="comments_user_id_foreign" to_schema="myapp" to_table="users" delete_action="cascade" >
90+
<fk_column name="user_id" pk="id" />
91+
</fk>
92+
</table>
93+
<table name="migrations" >
94+
<column name="migration" type="varchar" length="255" decimal="0" jt="12" mandatory="y" />
95+
<column name="batch" type="int" length="10" decimal="0" jt="4" mandatory="y" />
96+
</table>
97+
<table name="password_resets" >
98+
<column name="email" type="varchar" length="255" decimal="0" jt="12" mandatory="y" />
99+
<column name="token" type="varchar" length="255" decimal="0" jt="12" mandatory="y" />
100+
<column name="created_at" type="timestamp" length="19" decimal="0" jt="93" />
101+
<index name="password_resets_email_index" unique="NORMAL" >
102+
<column name="email" />
103+
</index>
104+
<index name="password_resets_token_index" unique="NORMAL" >
105+
<column name="token" />
106+
</index>
107+
</table>
108+
<table name="tags" >
109+
<column name="id" type="int" length="10" decimal="0" jt="4" mandatory="y" unsigned="y" autoincrement="y" />
110+
<column name="name" type="varchar" length="255" decimal="0" jt="12" mandatory="y" />
111+
<column name="slug" type="varchar" length="255" decimal="0" jt="12" mandatory="y" />
112+
<column name="created_at" type="timestamp" length="19" decimal="0" jt="93" />
113+
<column name="updated_at" type="timestamp" length="19" decimal="0" jt="93" />
114+
<column name="ko" type="varchar" length="255" decimal="0" jt="12" />
115+
<column name="en" type="varchar" length="255" decimal="0" jt="12" />
116+
<index name="pk_tags" unique="PRIMARY_KEY" >
117+
<column name="id" />
118+
</index>
119+
<index name="tags_slug_index" unique="NORMAL" >
120+
<column name="slug" />
121+
</index>
122+
</table>
123+
<table name="users" >
124+
<column name="id" type="int" length="10" decimal="0" jt="4" mandatory="y" unsigned="y" autoincrement="y" />
125+
<column name="name" type="varchar" length="255" decimal="0" jt="12" mandatory="y" />
126+
<column name="email" type="varchar" length="255" decimal="0" jt="12" mandatory="y" />
127+
<column name="password" type="varchar" length="60" decimal="0" jt="12" />
128+
<column name="remember_token" type="varchar" length="100" decimal="0" jt="12" />
129+
<column name="created_at" type="timestamp" length="19" decimal="0" jt="93" />
130+
<column name="updated_at" type="timestamp" length="19" decimal="0" jt="93" />
131+
<column name="last_login" type="timestamp" length="19" decimal="0" jt="93" />
132+
<column name="confirm_code" type="varchar" length="60" decimal="0" jt="12" />
133+
<column name="activated" type="bit" decimal="0" jt="-7" mandatory="y" >
134+
<defo>0</defo>
135+
</column>
136+
<index name="pk_users" unique="PRIMARY_KEY" >
137+
<column name="id" />
138+
</index>
139+
<index name="users_email_unique" unique="UNIQUE" >
140+
<column name="email" />
141+
</index>
142+
</table>
143+
<table name="votes" >
144+
<column name="id" type="int" length="10" decimal="0" jt="4" mandatory="y" unsigned="y" autoincrement="y" />
145+
<column name="user_id" type="int" length="10" decimal="0" jt="4" mandatory="y" unsigned="y" />
146+
<column name="comment_id" type="int" length="10" decimal="0" jt="4" mandatory="y" unsigned="y" />
147+
<column name="up" type="bit" decimal="0" jt="-7" />
148+
<column name="down" type="bit" decimal="0" jt="-7" />
149+
<column name="voted_at" type="timestamp" length="19" decimal="0" jt="93" mandatory="y" >
150+
<defo>CURRENT_TIMESTAMP</defo>
151+
</column>
152+
<index name="pk_votes" unique="PRIMARY_KEY" >
153+
<column name="id" />
154+
</index>
155+
<index name="votes_comment_id_foreign" unique="NORMAL" >
156+
<column name="comment_id" />
157+
</index>
158+
<index name="votes_user_id_foreign" unique="NORMAL" >
159+
<column name="user_id" />
160+
</index>
161+
<fk name="votes_comment_id_foreign" to_schema="myapp" to_table="comments" delete_action="cascade" >
162+
<fk_column name="comment_id" pk="id" />
163+
</fk>
164+
<fk name="votes_user_id_foreign" to_schema="myapp" to_table="users" delete_action="cascade" >
165+
<fk_column name="user_id" pk="id" />
166+
</fk>
167+
</table>
168+
</schema>
169+
<connector name="myapp" database="MySql" driver_class="com.mysql.jdbc.Driver" driver_jar="mysql-connector-java-5.1.40-bin.jar" driver_desc="Standard" host="localhost" port="3306" instance="myapp" user="root" />
170+
<layout name="Default Layout" id="Layout_1ea545d" show_relation="columns" >
171+
<entity schema="myapp" name="article_tag" color="bfd4f5" x="224" y="304" />
172+
<entity schema="myapp" name="articles" color="bfd4f5" x="48" y="304" />
173+
<entity schema="myapp" name="attachments" color="c8f5bf" x="848" y="48" />
174+
<entity schema="myapp" name="comments" color="bfd4f5" x="224" y="48" />
175+
<entity schema="myapp" name="migrations" color="c8f5bf" x="848" y="272" />
176+
<entity schema="myapp" name="password_resets" color="c8f5bf" x="672" y="272" />
177+
<entity schema="myapp" name="tags" color="c8f5bf" x="672" y="48" />
178+
<entity schema="myapp" name="users" color="bfd4f5" x="432" y="48" />
179+
<entity schema="myapp" name="votes" color="bfd4f5" x="48" y="48" />
180+
</layout>
181+
<layout name="Sample Layout with Groups" id="Layout_878282f" show_relation="columns" >
182+
<entity schema="myapp" name="article_tag" color="bfd4f5" x="224" y="448" />
183+
<entity schema="myapp" name="articles" color="bfd4f5" x="48" y="448" />
184+
<entity schema="myapp" name="attachments" color="c8f5bf" x="848" y="192" />
185+
<entity schema="myapp" name="comments" color="bfd4f5" x="224" y="192" />
186+
<entity schema="myapp" name="migrations" color="c8f5bf" x="848" y="416" />
187+
<entity schema="myapp" name="password_resets" color="c8f5bf" x="672" y="416" />
188+
<entity schema="myapp" name="tags" color="c8f5bf" x="672" y="192" />
189+
<entity schema="myapp" name="users" color="bfd4f5" x="432" y="192" />
190+
<entity schema="myapp" name="votes" color="bfd4f5" x="48" y="192" />
191+
<callout x="224" y="80" pointer="NO" >
192+
<comment><![CDATA[In DbSchema you may create multiple layouts with the same or different tables.
193+
Layouts will be saved to project file.
194+
Double-click any column, foreign key or table headers to edit.]]></comment>
195+
</callout>
196+
<group name="comments" color="ecf0f7" >
197+
<entity schema="myapp" name="comments" />
198+
<entity schema="myapp" name="users" />
199+
<entity schema="myapp" name="article_tag" />
200+
<entity schema="myapp" name="articles" />
201+
<entity schema="myapp" name="votes" />
202+
</group>
203+
<group name="tags" color="eef7ec" >
204+
<entity schema="myapp" name="tags" />
205+
<entity schema="myapp" name="attachments" />
206+
<entity schema="myapp" name="migrations" />
207+
<entity schema="myapp" name="password_resets" />
208+
</group>
209+
</layout>
210+
<layout name="Sample Layout with Relational Data Browse" id="Layout_26fe9c0a" show_relation="columns" >
211+
<entity schema="myapp" name="article_tag" color="bfd4f5" x="224" y="416" />
212+
<entity schema="myapp" name="articles" color="bfd4f5" x="48" y="416" />
213+
<entity schema="myapp" name="attachments" color="c8f5bf" x="848" y="160" />
214+
<entity schema="myapp" name="comments" color="bfd4f5" x="224" y="160" />
215+
<entity schema="myapp" name="migrations" color="c8f5bf" x="848" y="384" />
216+
<entity schema="myapp" name="password_resets" color="c8f5bf" x="672" y="384" />
217+
<entity schema="myapp" name="tags" color="c8f5bf" x="672" y="160" />
218+
<entity schema="myapp" name="users" color="bfd4f5" x="432" y="160" />
219+
<entity schema="myapp" name="votes" color="bfd4f5" x="48" y="160" />
220+
<callout x="224" y="48" pointer="NO" >
221+
<comment><![CDATA[Below is a Relational Data Browse for exploring and editing data from multiple tables at a time.
222+
Tables should be bind by foreign keys - if they are not you can create VIRTUAL foreign keys in the layout.
223+
Virtual foreign keys will be saved to project file.
224+
225+
Descend into children tables by pressing the foreign key arrow icon near title.
226+
Right-click column headers in browse tables to set filters.]]></comment>
227+
</callout>
228+
<browser id="Browse_2061bf65" name="Sample Relational Data Browse" confirm_updates="y" >
229+
<browse_table schema="myapp" entity="comments" x="10" y="10" width="400" height="300" >
230+
<browse_table schema="myapp" entity="users" fk="comments_user_id_foreign" x="420" y="10" width="400" height="300" record_view="y" />
231+
</browse_table>
232+
</browser>
233+
</layout>
234+
</project>

0 commit comments

Comments
 (0)