Files
HKSingleParty/99_references/dbml_examples/merchants.dbml.dot
2025-05-28 09:55:51 +08:00

298 lines
12 KiB
Plaintext

digraph dbml {
rankdir=LR;
graph [fontname="helvetica", fontsize=32, fontcolor="#29235c", bgcolor="transparent"];
node [penwidth=0, margin=0, fontname="helvetica", fontsize=32, fontcolor="#29235c"];
edge [fontname="helvetica", fontsize=32, fontcolor="#29235c", color="#29235c"];
"products_status" [id="products_status";label=<<TABLE BORDER="2" COLOR="#29235c" CELLBORDER="1" CELLSPACING="0" CELLPADDING="10">
<TR><TD PORT="f0" BGCOLOR="#29235c"><FONT COLOR="#ffffff"><B> products_status </B></FONT></TD></TR>
<TR><TD PORT="f0" BGCOLOR="#e7e2dd"><FONT COLOR="#1d71b8"><I> out_of_stock </I></FONT></TD></TR>
<TR><TD PORT="f1" BGCOLOR="#e7e2dd"><FONT COLOR="#1d71b8"><I> in_stock </I></FONT></TD></TR>
<TR><TD PORT="f2" BGCOLOR="#e7e2dd"><FONT COLOR="#1d71b8"><I> running_low </I></FONT></TD></TR>
</TABLE>>];
subgraph cluster_merchants {
label="merchants"
style=filled;
color="#dddddd";
"merchants" [id="merchants";label=<<TABLE BORDER="2" COLOR="#29235c" CELLBORDER="1" CELLSPACING="0" CELLPADDING="10">
<TR><TD PORT="f0" BGCOLOR="#1d71b8"><FONT COLOR="#ffffff"><B> merchants </B></FONT></TD></TR>
<TR><TD ALIGN="LEFT" PORT="f1" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT"><B>id</B> </TD>
<TD ALIGN="RIGHT"><FONT><I>int</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f2" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT"><B>country_code</B> </TD>
<TD ALIGN="RIGHT"><FONT><I>int</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f3" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">merchant_name </TD>
<TD ALIGN="RIGHT"><FONT><I>varchar</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f4" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">created at </TD>
<TD ALIGN="RIGHT"><FONT><I>varchar</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f5" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">admin_id </TD>
<TD ALIGN="RIGHT"><FONT><I>int</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD PORT="f6" BGCOLOR="#e7e2dd"><FONT COLOR="#1d71b8"><I> id, country_code </I></FONT></TD></TR>
</TABLE>>];
"merchant_periods" [id="merchant_periods";label=<<TABLE BORDER="2" COLOR="#29235c" CELLBORDER="1" CELLSPACING="0" CELLPADDING="10">
<TR><TD PORT="f0" BGCOLOR="#1d71b8"><FONT COLOR="#ffffff"><B> merchant_periods </B></FONT></TD></TR>
<TR><TD ALIGN="LEFT" PORT="f1" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT"><B>id</B> </TD>
<TD ALIGN="RIGHT"><FONT><I>int</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f2" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">merchant_id </TD>
<TD ALIGN="RIGHT"><FONT><I>int</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f3" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">country_code </TD>
<TD ALIGN="RIGHT"><FONT><I>int</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f4" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">start_date </TD>
<TD ALIGN="RIGHT"><FONT><I>datetime</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f5" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">end_date </TD>
<TD ALIGN="RIGHT"><FONT><I>datetime</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD PORT="f6" BGCOLOR="#e7e2dd"><FONT COLOR="#1d71b8"><I> merchant_id, country_code </I></FONT></TD></TR>
</TABLE>>];
}
"users" [id="users";label=<<TABLE BORDER="2" COLOR="#29235c" CELLBORDER="1" CELLSPACING="0" CELLPADDING="10">
<TR><TD PORT="f0" BGCOLOR="#1d71b8"><FONT COLOR="#ffffff"><B> users </B></FONT></TD></TR>
<TR><TD ALIGN="LEFT" PORT="f1" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT"><B>id</B> </TD>
<TD ALIGN="RIGHT"><FONT><I>int</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f2" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">full_name </TD>
<TD ALIGN="RIGHT"><FONT><I>varchar</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f3" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">created_at </TD>
<TD ALIGN="RIGHT"><FONT><I>timestamp</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f4" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">country_code </TD>
<TD ALIGN="RIGHT"><FONT><I>int</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
</TABLE>>];
"countries" [id="countries";label=<<TABLE BORDER="2" COLOR="#29235c" CELLBORDER="1" CELLSPACING="0" CELLPADDING="10">
<TR><TD PORT="f0" BGCOLOR="#1d71b8"><FONT COLOR="#ffffff"><B> countries </B></FONT></TD></TR>
<TR><TD ALIGN="LEFT" PORT="f1" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT"><B>code</B> </TD>
<TD ALIGN="RIGHT"><FONT><I>int</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f2" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">name </TD>
<TD ALIGN="RIGHT"><FONT><I>varchar</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f3" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">continent_name </TD>
<TD ALIGN="RIGHT"><FONT><I>varchar</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
</TABLE>>];
"order_items" [id="order_items";label=<<TABLE BORDER="2" COLOR="#29235c" CELLBORDER="1" CELLSPACING="0" CELLPADDING="10">
<TR><TD PORT="f0" BGCOLOR="#1d71b8"><FONT COLOR="#ffffff"><B> order_items </B></FONT></TD></TR>
<TR><TD ALIGN="LEFT" PORT="f1" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">order_id </TD>
<TD ALIGN="RIGHT"><FONT><I>int</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f2" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">product_id </TD>
<TD ALIGN="RIGHT"><FONT><I>int</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f3" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">quantity </TD>
<TD ALIGN="RIGHT"><FONT><I>int</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
</TABLE>>];
"orders" [id="orders";label=<<TABLE BORDER="2" COLOR="#29235c" CELLBORDER="1" CELLSPACING="0" CELLPADDING="10">
<TR><TD PORT="f0" BGCOLOR="#1d71b8"><FONT COLOR="#ffffff"><B> orders </B></FONT></TD></TR>
<TR><TD ALIGN="LEFT" PORT="f1" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT"><B>id</B> </TD>
<TD ALIGN="RIGHT"><FONT><I>int</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f2" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">user_id </TD>
<TD ALIGN="RIGHT"><FONT><I>int</I> <B>(!)</B></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f3" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">status </TD>
<TD ALIGN="RIGHT"><FONT><I>varchar</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f4" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">created_at </TD>
<TD ALIGN="RIGHT"><FONT><I>varchar</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
</TABLE>>];
"products" [id="products";label=<<TABLE BORDER="2" COLOR="#29235c" CELLBORDER="1" CELLSPACING="0" CELLPADDING="10">
<TR><TD PORT="f0" BGCOLOR="#1d71b8"><FONT COLOR="#ffffff"><B> products </B></FONT></TD></TR>
<TR><TD ALIGN="LEFT" PORT="f1" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT"><B>id</B> </TD>
<TD ALIGN="RIGHT"><FONT><I>int</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f2" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">name </TD>
<TD ALIGN="RIGHT"><FONT><I>varchar</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f3" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">merchant_id </TD>
<TD ALIGN="RIGHT"><FONT><I>int</I> <B>(!)</B></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f4" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">price </TD>
<TD ALIGN="RIGHT"><FONT><I>int</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f5" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">status </TD>
<TD ALIGN="RIGHT"><FONT><I>products_status</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
<TR><TD ALIGN="LEFT" PORT="f6" BGCOLOR="#e7e2dd">
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD ALIGN="LEFT">created_at </TD>
<TD ALIGN="RIGHT"><FONT><I>datetime</I></FONT></TD>
</TR>
</TABLE>
</TD></TR>
</TABLE>>];
"users":f0 -> "countries":f0 [style=invis, weight=100, color=red]
"users":f4:e -> "countries":f1:w [dir=forward, penwidth=3, color="#29235c", headlabel="1", taillabel="*"]
"merchants":f0 -> "countries":f0 [style=invis, weight=100, color=red]
"merchants":f2:e -> "countries":f1:w [dir=forward, penwidth=3, color="#29235c", headlabel="1", taillabel="*"]
"order_items":f0 -> "products":f0 [style=invis, weight=100, color=red]
"order_items":f2:e -> "products":f1:w [dir=forward, penwidth=3, color="#29235c", headlabel="1", taillabel="*"]
"products":f0 -> "merchants":f0 [style=invis, weight=100, color=red]
"products":f3:e -> "merchants":f1:w [dir=forward, penwidth=3, color="#29235c", headlabel="1", taillabel="*"]
"merchant_periods":f0 -> "merchants":f0 [style=invis, weight=100, color=red]
"merchant_periods":f6:e -> "merchants":f6:w [dir=forward, penwidth=3, color="#29235c", headlabel="1", taillabel="*"]
"order_items":f0 -> "orders":f0 [style=invis, weight=100, color=red]
"order_items":f1:e -> "orders":f1:w [dir=forward, penwidth=3, color="#29235c", headlabel="1", taillabel="*"]
"merchants":f0 -> "users":f0 [style=invis, weight=100, color=red]
"merchants":f5:e -> "users":f1:w [dir=forward, penwidth=3, color="#29235c", headlabel="1", taillabel="*"]
"products":f5:e -> "products_status":f0:w [penwidth=3, color="#29235c", arrowhead="none", arrowtail="none"]
}