digraph schema { graph [rankdir=TB, splines=spline, overlap=false, bgcolor="#ebf4ff", nodesep=0.95, ranksep=1.0, pad=0.5, fontname="Helvetica", compound=true, newrank=true, mclimit=4.0]; node [shape=plaintext, fontname="Helvetica"]; edge [fontname="Helvetica", fontsize=9, penwidth=1.4, arrowsize=0.7]; subgraph cluster_identity { label="Identity & Company"; labeljust="l"; fontsize=15; style="rounded,filled"; fillcolor="#ffffff60"; color="#a0aec0"; fontcolor="#1a365d"; margin=14; customergroup [label=<
customergroup
idINT PK
company_id?INT FK
nameNVARCHAR(255)
>]; meta [label=<
meta
keyNVARCHAR(255)
valueNVARCHAR(MAX)
>]; numbers [label=<
numbers
idINT PK
company_idINT FK
typeNVARCHAR(100)
prefixNVARCHAR(50)
paddingINT
nextINT
>]; entityaddress [label=<
entityaddress
idINT PK
entity_idINT FK
first_name?NVARCHAR(255)
name?NVARCHAR(255)
street?NVARCHAR(255)
streetnumber?NVARCHAR(50)
zip?NVARCHAR(50)
city?NVARCHAR(255)
county?NVARCHAR(255)
addresstypeNVARCHAR(50)
sortINT
>]; entity [label=<
entity
idINT PK
customergroup_idINT FK
first_name?NVARCHAR(255)
nameNVARCHAR(255)
created_atDATETIME2
updated_atDATETIME2
>]; companyuser [label=<
companyuser
idINT PK
company_idINT FK
google_auth_idINT FK
>]; entitycontact [label=<
entitycontact
idINT PK
entity_idINT FK
contacttypeNVARCHAR(50)
contactNVARCHAR(255)
sortINT
>]; company [label=<
company
idINT PK
taxrate?INT FK
reducedtaxrate?INT FK
taxfreerate?INT FK
poscustomergroup_idINT FK
root_category_id?INT FK
default_language_id?INT FK
nameNVARCHAR(255)
>]; syncpos [label=<
syncpos
idINT PK
company_idINT FK
paircodeNVARCHAR(50)
token?NVARCHAR(255)
>]; entityhistory [label=<
entityhistory
idINT PK
entity_idINT FK
companyuser_id?INT FK
dateDATETIME2
textNVARCHAR(MAX)
>]; companysetting [label=<
companysetting
idINT PK
company_idINT FK
keyNVARCHAR(255)
valueNVARCHAR(MAX)
frontendBIT
>]; google_auth [label=<
google_auth
idINT PK
selected_company?INT FK
emailNVARCHAR(320)
picture?NVARCHAR(2048)
picturebinary?VARBINARY(MAX)
sub?NVARCHAR(255)
created_atDATETIME2
>]; } subgraph cluster_i18n { label="Localization"; labeljust="l"; fontsize=15; style="rounded,filled"; fillcolor="#ffffff60"; color="#a0aec0"; fontcolor="#1a365d"; margin=14; language [label=<
language
idINT PK
iso639NVARCHAR(10)
>]; unittext [label=<
unittext
idINT PK
language_idINT FK
unit_idINT FK
symbolNVARCHAR(50)
nameNVARCHAR(255)
>]; articletext [label=<
articletext
idINT PK
article_idINT FK
language_idINT FK
nameNVARCHAR(255)
slugNVARCHAR(255)
seo?NVARCHAR(MAX)
desc?NVARCHAR(MAX)
>]; categorytext [label=<
categorytext
idINT PK
category_idINT FK
language_idINT FK
nameNVARCHAR(255)
slugNVARCHAR(255)
seo?NVARCHAR(MAX)
desc?NVARCHAR(MAX)
>]; } subgraph cluster_catalog { label="Catalog"; labeljust="l"; fontsize=15; style="rounded,filled"; fillcolor="#ffffff60"; color="#a0aec0"; fontcolor="#1a365d"; margin=14; brand [label=<
brand
idINT PK
company_idINT FK
nameNVARCHAR(255)
gsprpinfo?NVARCHAR(MAX)
>]; articlehistory [label=<
articlehistory
idINT PK
companyuser_id?INT FK
article_idINT FK
dateDATETIME2
textNVARCHAR(MAX)
>]; article [label=<
article
idINT PK
brand_id?INT FK
fatherarticle_id?INT FK
articlelist_id?INT FK
optionslist_id?INT FK
unit_idINT FK
sku?NVARCHAR(100)
unitamountFLOAT
weightFLOAT
is_fatherBIT
fathersortINT
created_atDATETIME2
updated_atDATETIME2
>]; articleean [label=<
articleean
idINT PK
article_idINT FK
eanNVARCHAR(50)
>]; category [label=<
category
idINT PK
parent_id?INT FK
sortINT
>]; articlelist [label=<
articlelist
idINT PK
>]; categoryarticle [label=<
categoryarticle
idINT PK
article_idINT FK
category_idINT FK
>]; articlelistarticle [label=<
articlelistarticle
idINT PK
article_idINT FK
articlelist_idINT FK
countINT
sortINT
>]; optionslistarticle [label=<
optionslistarticle
idINT PK
article_idINT FK
optionslist_idINT FK
countINT
sortINT
mandatedBIT
>]; optionslist [label=<
optionslist
idINT PK
>]; } subgraph cluster_media { label="Media"; labeljust="l"; fontsize=15; style="rounded,filled"; fillcolor="#ffffff60"; color="#a0aec0"; fontcolor="#1a365d"; margin=14; pic [label=<
pic
idINT PK
wINT
hINT
sizeBIGINT
hashNVARCHAR(64)
thumbwINT
thumbhINT
thumbhashNVARCHAR(64)
sourceNVARCHAR(MAX)
fullbinaryVARBINARY(MAX)
thumbbinaryVARBINARY(MAX)
>]; articlepic [label=<
articlepic
idINT PK
pic_idINT FK
article_idINT FK
sortINT
>]; brandpic [label=<
brandpic
idINT PK
pic_idINT FK
brand_idINT FK
sortINT
>]; categorypic [label=<
categorypic
idINT PK
pic_idINT FK
category_idINT FK
sortINT
>]; } subgraph cluster_commerce { label="Pricing & Documents"; labeljust="l"; fontsize=15; style="rounded,filled"; fillcolor="#ffffff60"; color="#a0aec0"; fontcolor="#1a365d"; margin=14; ledger [label=<
ledger
idINT PK
manifestarticle_idINT FK
transaction_typeNVARCHAR(100)
amountFLOAT
transaction_textNVARCHAR(MAX)
hash_versionINT
prev_hash?NVARCHAR(128)
>]; manifestarticle [label=<
manifestarticle
idINT PK
manifest_idINT FK
tax_idINT FK
article_id?INT FK
amountFLOAT
netFLOAT
comment?NVARCHAR(MAX)
rebateFLOAT
>]; manifest [label=<
manifest
idINT PK
entity_id?INT FK
company_idINT FK
numberNVARCHAR(100)
typeNVARCHAR(100)
dateDATETIME2
>]; price [label=<
price
idINT PK
tax_idINT FK
customergroup_idINT FK
article_idINT FK
minmultiplierDECIMAL(18,4)
netFLOAT
>]; tax [label=<
tax
idINT PK
rateDECIMAL(18,4)
>]; } subgraph cluster_units { label="Units"; labeljust="l"; fontsize=15; style="rounded,filled"; fillcolor="#ffffff60"; color="#a0aec0"; fontcolor="#1a365d"; margin=14; unit [label=<
unit
idINT PK
company_idINT FK
siNVARCHAR(50)
basesiNVARCHAR(50)
basesifactorFLOAT
>]; } posterminal [label=<
posterminal
idINT PK
company_idINT FK
nameNVARCHAR(255)
token?NVARCHAR(255)
pairingpinNVARCHAR(50)
>]; posterminalcategory [label=<
posterminalcategory
idINT PK
category_idINT FK
posterminal_idINT FK
>]; __legend [label=<
Legend
PKprimary key
FKforeign key
?nullable column
—FOREIGN KEY constraint
- -naming convention only, no constraint
>]; google_auth:selected_company:w -> company:in7:n [color="#c53030", fontcolor="#c53030", tooltip="FK_google_auth_selected_company", weight=3]; category:parent_id:e -> category:id:e [color="#2f855a", fontcolor="#2f855a", tooltip="FK_category_parent", constraint=false]; company:root_category_id:e -> category:in0:n [color="#2b6cb0", fontcolor="#2b6cb0", tooltip="FK_company_root_category", constraint=false, weight=1]; company:default_language_id:e -> language:in0:n [color="#b7791f", fontcolor="#b7791f", tooltip="FK_company_default_language", constraint=false, weight=1]; company:taxrate:w -> tax:in3:n [color="#6b46c1", fontcolor="#6b46c1", tooltip="FK_company_taxrate", constraint=false, weight=1]; company:reducedtaxrate:w -> tax:in2:n [color="#c05621", fontcolor="#c05621", tooltip="FK_company_reducedtaxrate", weight=3]; company:taxfreerate:w -> tax:in4:n [color="#319795", fontcolor="#319795", tooltip="FK_company_taxfreerate", constraint=false, weight=1]; customergroup:company_id:w -> company:in1:n [color="#97266d", fontcolor="#97266d", tooltip="FK_customergroup_company", weight=3]; company:poscustomergroup_id:w -> customergroup:in2:n [color="#4c51bf", fontcolor="#4c51bf", tooltip="FK_company_poscustomergroup", constraint=false, weight=1]; entity:customergroup_id:nw -> customergroup:in1:n [color="#276749", fontcolor="#276749", tooltip="FK_entity_customergroup", weight=3]; entityaddress:entity_id:sw -> entity:in1:n [color="#9c4221", fontcolor="#9c4221", tooltip="FK_entityaddress_entity", weight=3]; entitycontact:entity_id:se -> entity:in2:n [color="#0987a0", fontcolor="#0987a0", tooltip="FK_entitycontact_entity", weight=3]; entityhistory:entity_id:sw -> entity:in3:n [color="#553c9a", fontcolor="#553c9a", tooltip="FK_entityhistory_entity", weight=3]; entityhistory:companyuser_id:se -> companyuser:in0:n [color="#742a2a", fontcolor="#742a2a", tooltip="FK_entityhistory_companyuser", constraint=false, weight=1]; unit:company_id:e -> company:in8:n [color="#22543d", fontcolor="#22543d", tooltip="FK_unit_company", weight=3]; unittext:unit_id:se -> unit:in1:n [color="#1a365d", fontcolor="#1a365d", tooltip="FK_unittext_unit", weight=3]; unittext:language_id:nw -> language:in1:n [color="#702459", fontcolor="#702459", tooltip="FK_unittext_language", constraint=false, weight=1]; brand:company_id:w -> company:in6:n [color="#744210", fontcolor="#744210", tooltip="FK_brand_company", weight=3]; article:unit_id:e -> unit:in0:n [color="#285e61", fontcolor="#285e61", tooltip="FK_article_unit", constraint=false, weight=1]; article:brand_id:sw -> brand:in1:n [color="#d53f8c", fontcolor="#d53f8c", tooltip="FK_article_brand", constraint=false, weight=1]; article:articlelist_id:nw -> articlelist:in1:n [color="#dd6b20", fontcolor="#dd6b20", tooltip="FK_article_articlelist", weight=3]; article:optionslist_id:e -> optionslist:in0:n [color="#38a169", fontcolor="#38a169", tooltip="FK_article_optionslist", constraint=false, weight=1]; article:fatherarticle_id:e -> article:id:e [color="#3182ce", fontcolor="#3182ce", tooltip="FK_article_fatherarticle", constraint=false]; articlehistory:article_id:sw -> article:in3:n [color="#805ad5", fontcolor="#805ad5", tooltip="FK_articlehistory_article", weight=3]; articlehistory:companyuser_id:w -> companyuser:in1:n [color="#c53030", fontcolor="#c53030", tooltip="FK_articlehistory_companyuser", constraint=false, weight=1]; articleean:article_id:sw -> article:in6:n [color="#2f855a", fontcolor="#2f855a", tooltip="FK_articleean_article", weight=3]; articlepic:article_id:e -> article:in2:n [color="#2b6cb0", fontcolor="#2b6cb0", tooltip="FK_articlepic_article", weight=3]; articlepic:pic_id:e -> pic:in1:n [color="#b7791f", fontcolor="#b7791f", tooltip="FK_articlepic_pic", constraint=false, weight=1]; brandpic:brand_id:se -> brand:in0:n [color="#6b46c1", fontcolor="#6b46c1", tooltip="FK_brandpic_brand", weight=3]; brandpic:pic_id:nw -> pic:in2:n [color="#c05621", fontcolor="#c05621", tooltip="FK_brandpic_pic", constraint=false, weight=1]; articlelistarticle:articlelist_id:se -> articlelist:in0:n [color="#319795", fontcolor="#319795", tooltip="FK_articlelistarticle_articlelist", weight=3]; articlelistarticle:article_id:w -> article:in5:n [color="#97266d", fontcolor="#97266d", tooltip="FK_articlelistarticle_article", constraint=false, weight=1]; optionslistarticle:optionslist_id:se -> optionslist:in1:n [color="#4c51bf", fontcolor="#4c51bf", tooltip="FK_optionslistarticle_optionslist", weight=3]; optionslistarticle:article_id:w -> article:in8:n [color="#276749", fontcolor="#276749", tooltip="FK_optionslistarticle_article", constraint=false, weight=1]; categoryarticle:category_id:se -> category:in3:n [color="#9c4221", fontcolor="#9c4221", tooltip="FK_categoryarticle_category", weight=3]; categoryarticle:article_id:sw -> article:in7:n [color="#0987a0", fontcolor="#0987a0", tooltip="FK_categoryarticle_article", constraint=false, weight=1]; categorypic:category_id:w -> category:in1:n [color="#553c9a", fontcolor="#553c9a", tooltip="FK_categorypic_category", weight=3]; categorypic:pic_id:w -> pic:in0:n [color="#742a2a", fontcolor="#742a2a", tooltip="FK_categorypic_pic", constraint=false, weight=1]; categorytext:category_id:w -> category:in4:n [color="#22543d", fontcolor="#22543d", tooltip="FK_categorytext_category", weight=3]; categorytext:language_id:e -> language:in3:n [color="#1a365d", fontcolor="#1a365d", tooltip="FK_categorytext_language", constraint=false, weight=1]; articletext:article_id:e -> article:in9:n [color="#702459", fontcolor="#702459", tooltip="FK_articletext_article", weight=3]; articletext:language_id:w -> language:in2:n [color="#744210", fontcolor="#744210", tooltip="FK_articletext_language", constraint=false, weight=1]; price:tax_id:nw -> tax:in1:n [color="#285e61", fontcolor="#285e61", tooltip="FK_price_tax", constraint=false, weight=1]; price:article_id:w -> article:in1:n [color="#d53f8c", fontcolor="#d53f8c", tooltip="FK_price_article", weight=3]; price:customergroup_id:se -> customergroup:in0:n [color="#dd6b20", fontcolor="#dd6b20", tooltip="FK_price_customergroup", constraint=false, weight=1]; manifest:company_id:e -> company:in0:n [color="#38a169", fontcolor="#38a169", tooltip="FK_manifest_company", weight=3]; manifest:entity_id:e -> entity:in0:n [color="#3182ce", fontcolor="#3182ce", tooltip="FK_manifest_entity", constraint=false, weight=1]; manifestarticle:manifest_id:sw -> manifest:in0:n [color="#805ad5", fontcolor="#805ad5", tooltip="FK_manifestarticle_manifest", weight=3]; manifestarticle:article_id:e -> article:in0:n [color="#c53030", fontcolor="#c53030", tooltip="FK_manifestarticle_article", constraint=false, weight=1]; manifestarticle:tax_id:sw -> tax:in0:n [color="#2f855a", fontcolor="#2f855a", tooltip="FK_manifestarticle_tax", constraint=false, weight=1]; ledger:manifestarticle_id:ne -> manifestarticle:in0:n [color="#2b6cb0", fontcolor="#2b6cb0", tooltip="FK_ledger_manifestarticle", weight=3]; numbers:company_id:e -> company:in2:n [color="#b7791f", fontcolor="#b7791f", tooltip="FK_numbers_company", weight=3]; companyuser:google_auth_id:e -> google_auth:in0:n [color="#6b46c1", fontcolor="#6b46c1", tooltip="FK_companyuser_google_auth", constraint=false, weight=1]; companyuser:company_id:sw -> company:in3:n [color="#c05621", fontcolor="#c05621", tooltip="FK_companyuser_company", weight=3]; syncpos:company_id:se -> company:in4:n [color="#319795", fontcolor="#319795", tooltip="FK_syncpos_company", weight=3]; companysetting:company_id:sw -> company:in5:n [color="#97266d", fontcolor="#97266d", tooltip="FK_companysetting_company", weight=3]; posterminal:company_id:w -> company:in9:n [color="#4c51bf", fontcolor="#4c51bf", tooltip="FK_posterminal_company", weight=3]; posterminalcategory:posterminal_id:sw -> posterminal:in0:n [color="#276749", fontcolor="#276749", tooltip="FK_posterminalcategory_posterminal", weight=3]; posterminalcategory:category_id:w -> category:in5:n [color="#9c4221", fontcolor="#9c4221", tooltip="FK_posterminalcategory_category", constraint=false, weight=1]; }