From 59395f95d8d79b7489b19f92da70c209fd930d73 Mon Sep 17 00:00:00 2001 From: seb Date: Sat, 17 Oct 2026 02:47:20 +0200 Subject: [PATCH] u --- API.md | 20 +- API.runner.js.md | 20 - generate-api-doc.js | 19 + generate-schema-graph.js | 2 +- schema-graph.dot | 280 +- schema-graph.svg | 6165 ++++++++++++++++--------------- src/providers/mssql/schema.js | 21 + src/providers/sqlite3/schema.js | 18 + 8 files changed, 3330 insertions(+), 3215 deletions(-) delete mode 100644 API.runner.js.md diff --git a/API.md b/API.md index f308a40..ec5bc93 100644 --- a/API.md +++ b/API.md @@ -8,6 +8,7 @@ The store is exposed as a `LibDashStore` instance (see `src/index.js`). Each met > **Convention**: `PK` primary key · `?` nullable · `->tbl` foreign key · `UQ` unique · `s(N)` string · `txt` text · `i` int · `bi` bigint · `f` float · `d` decimal · `b` bit · `dt` datetime · `bin` binary · `=val` default +- **account**: `id PK, company_id->company, type:s(100), name:s(255)` - **article**: `id PK, sku?:s(100) UQ, unit_id->unit, unitamount:f, weight:f, track_stock:b=1, brand_id?->brand, articlelist_id?->articlelist, optionslist_id?->optionslist, is_parent:b=0, parentarticle_id?->article, parentattributename_id?->attributename, parentsort:i=0, created_at:dt, updated_at:dt, UQ(parentarticle_id, parentsort)` - **articleattributevalue**: `id PK, article_id->article, attributevalue_id->attributevalue, sort:i=0, UQ(article_id, attributevalue_id)` - **articleean**: `id PK, article_id->article, ean:s(50) UQ` @@ -18,6 +19,7 @@ The store is exposed as a `LibDashStore` instance (see `src/index.js`). Each met - **articleproperty**: `id PK, article_id->article, property_id->propertyname, value:txt, sort:i=0` - **articlesupplier**: `id PK, article_id->article, entity_id->entity, net?:f, tax_id?->tax, sku?:s(100), stock?:f, pu:f=1, sort:i=0, UQ(article_id, entity_id), UQ(article_id, sort)` - **articletext**: `id PK, article_id->article, language_id->language, name:s(255), slug:s(255), seo?:txt, desc?:txt, UQ(article_id, language_id)` +- **articletombstone**: `id PK, company_id->company, article_id?:i, sku?:s(100), name?:s(255), taxrate?:d(18,4), net?:f, deleted_at:dt` - **attributename**: `id PK, company_id->company, name:s(255), sort:i=0, exclusive:b=0, UQ(company_id, name)` - **attributevalue**: `id PK, attribute_id->attributename, value:s(255), sort:i=0, UQ(attribute_id, value)` - **attributevaluepic**: `id PK, attributevalue_id->attributevalue, pic_id->pic, sort:i=0, UQ(attributevalue_id, pic_id), UQ(attributevalue_id, sort)` @@ -25,13 +27,16 @@ The store is exposed as a `LibDashStore` instance (see `src/index.js`). Each met - **brandpic**: `id PK, brand_id->brand, pic_id->pic, sort:i=0, UQ(brand_id, pic_id), UQ(brand_id, sort)` - **category**: `id PK, parent_id?->category, sort:i=0` - **categoryarticle**: `id PK, category_id->category, article_id->article, UQ(category_id, article_id)` +- **categoryattributevalue**: `id PK, category_id->category, attributevalue_id->attributevalue, sort:i=0, UQ(category_id, attributevalue_id)` - **categorypic**: `id PK, category_id->category, pic_id->pic, sort:i=0, UQ(category_id, pic_id), UQ(category_id, sort)` +- **categoryproperty**: `id PK, category_id->category, property_id->propertyname, value:txt, sort:i=0` - **categorytext**: `id PK, category_id->category, language_id->language, name:s(255), slug:s(255), seo?:txt, desc?:txt, UQ(category_id, language_id)` - **company**: `id PK, name:s(255) UQ, root_category_id?->category, default_language_id?->language, taxrate?->tax, reducedtaxrate?->tax, taxfreerate?->tax, poscustomergroup_id->customergroup` - **companyhistory**: `id PK, company_id->company, companyuser_id?->companyuser, date:dt, text:txt` - **companysetting**: `id PK, company_id->company, key:s(255), value:txt, frontend:b=0, writeonly:b=0, UQ(company_id, key)` - **companyuser**: `id PK, google_auth_id->google_auth, company_id->company, UQ(google_auth_id, company_id)` - **customergroup**: `id PK, name:s(255), sort:i=0, company_id?->company` +- **deliverysummary**: `id PK, company_id->company, manifest_id->manifest UQ, delivery_number:s(100), external_number?:s(100), delivery_date:dt, created_at:dt, supplier_id?->entity, supplier_name?:s(255), positions:i=0, gross_total:f=0, net_total:f=0, total_quantity:f=0, stock_positions:i=0, booked_positions:i=0, unbooked_positions:i=0, stock_quantity:f=0, booked_quantity:f=0, unbooked_quantity:f=0, is_booked:b=0` - **entity**: `id PK, customergroup_id->customergroup, first_name?:s(255), name:s(255), number?:s(100), created_at:dt, updated_at:dt, UQ(company_id, number)` - **entityaddress**: `id PK, entity_id->entity, first_name?:s(255), name?:s(255), street?:s(255), streetnumber?:s(50), zip?:s(50), city?:s(255), county?:s(255), addresstype:s(50), sort:i=0` - **entitycontact**: `id PK, entity_id->entity, contacttype:s(50), contact:s(255), sort:i=0` @@ -44,16 +49,29 @@ The store is exposed as a `LibDashStore` instance (see `src/index.js`). Each met - **manifest**: `id PK, company_id->company, number:s(100), type:s(100), entity_id?->entity, external_number?:s(100), date:dt, created_at:dt` - **manifestarticle**: `id PK, manifest_id->manifest, sku?:s(100), name?:s(255), pu:f=1, amount:f, net:f, comment?:txt, rebate:f=0, taxrate:f=0` - **manifestattachment**: `id PK, manifest_id->manifest, file_id->file, sort:i=0, UQ(manifest_id, sort)` +- **mcp_auth_code**: `code:s(128) PK, client_id:s(100), google_auth_id->google_auth, redirect_uri:s(2048), code_challenge:s(255), code_challenge_method:s(32), scope?:s(255), expires_at:dt, used:b=0, created_at:dt` +- **mcp_client**: `id PK, client_id:s(100) UQ, client_secret?:s(255), client_name:s(255), redirect_uris:txt, grant_types?:s(255), response_types?:s(255), scope?:s(255), created_at:dt` +- **mcp_token**: `id PK, refresh_token:s(128) UQ, client_id:s(100), google_auth_id->google_auth, scope?:s(255), expires_at:dt, revoked:b=0, created_at:dt` - **meta**: `key:s(255) PK, value:txt` +- **modelconversation**: `id PK, companyuser_id->companyuser, provider:s(100), model:s(255), created_at:dt, updated_at:dt, state:s(20)='idle', started_by?:i` +- **modelmessage**: `id PK, conversation_id->modelconversation, created_at:dt, role:s(20), message:txt` +- **modelvfs**: `id PK, company_id->company, name:s(255), mime:s(100), content:bin, meta?:txt, created_at:dt, updated_at:dt, UQ(company_id, name)` - **numbers**: `id PK, company_id->company, type:s(100), prefix:s(50)='', padding:i=0, next:i=1, UQ(company_id, type)` - **optionslist**: `id PK` - **optionslistarticle**: `id PK, optionslist_id->optionslist, article_id->article, count:i=1, sort:i=0, mandated:b=0, UQ(optionslist_id, article_id), UQ(optionslist_id, sort)` +- **ordersummary**: `id PK, company_id->company, manifest_id->manifest UQ, order_number:s(100), order_date:dt, created_at:dt, entity_id?->entity, customer_name?:s(255), positions:i=0, gross_total:f=0, paid_total:f=0, ordered_quantity:f=0, shipped_quantity:f=0, is_paid:b=0, is_shipped:b=0` +- **package**: `id PK, shipping_id->shipping, entityaddress_id->entityaddress, number:s(100), type:s(100), state:s(100), details?:txt` +- **payment**: `id PK, account_id->account, manifest_id->manifest, type:s(100), amount:f` - **pic**: `id PK, w:i, h:i, size:bi, hash:s(64) UQ, thumbw:i, thumbh:i, thumbhash:s(64), source:txt, fullbinary:bin, thumbbinary:bin` - **posterminal**: `id PK, company_id->company, name:s(255), token?:s(255) UQ, pairingpin?:s(50), root_category_id?->category, sync_root_articles:b=1, lastseen_at?:dt, updated_at:dt` - **posterminalcategory**: `id PK, posterminal_id->posterminal, category_id->category, UQ(posterminal_id, category_id)` - **price**: `id PK, tax_id->tax, article_id->article, minmultiplier:d(18,4)=1, customergroup_id->customergroup, net:f` - **printer**: `id PK, company_id->company, address:s(255), type:s(50), model?:s(255), serial?:s(255), sort:i=0, desc?:txt` - **propertyname**: `id PK, company_id->company, name:s(255), sort:i=0, exclusive:b=0, UQ(company_id, name)` +- **quotesummary**: `id PK, company_id->company, manifest_id->manifest UQ, quote_number:s(100), quote_date:dt, created_at:dt, entity_id?->entity, customer_name?:s(255), positions:i=0, gross_total:f=0, total_quantity:f=0` +- **shipmentsummary**: `id PK, company_id->company, manifest_id->manifest UQ, shipment_number:s(100), shipment_date:dt, created_at:dt, order_id?:i, order_number?:s(100), entity_id?->entity, customer_name?:s(255), positions:i=0, total_quantity:f=0, package_count:i=0, carrier?:s(100), tracking_code?:s(255), state:s(50)='new'` +- **shipping**: `id PK, manifest_id->manifest, number:s(100), tracking_code?:s(255), carrier?:s(100), type:s(100), state:s(100)` +- **subagentschedule**: `id PK, company_id->company, desc?:txt, prompt:txt, skills?:txt, lastagentnote?:txt, max_itr:i=15, cron:s(100), created_at:dt, lastrun_at?:dt` - **tax**: `id PK, rate:d(18,4) UQ` - **unit**: `id PK, company_id->company, si:s(50), basesi:s(50), basesifactor:f, UQ(company_id, si)` - **unittext**: `id PK, unit_id->unit, language_id->language, symbol:s(50), name:s(255), UQ(unit_id, language_id)` @@ -363,5 +381,3 @@ The store is exposed as a `LibDashStore` instance (see `src/index.js`). Each met - `create(googleAuthId: number, input: {accountId: number, manifestId: number, type: string, amount: number}, tx?: object): Promise<{id: number, accountId: number, manifestId: number, type: string, amount: number}>` - `delete(googleAuthId: number, id: number, tx?: object): Promise` - `listByManifestId(googleAuthId: number, manifestId: number, tx?: object): Promise>` -- [runner.js](API.runner.js.md) - - `runner(provider: import('../providers/provider.js').DatabaseProvider, tx?: object): ((sql: string, params?: object) => Promise) & { query: Function, dialect?: string }` diff --git a/API.runner.js.md b/API.runner.js.md deleted file mode 100644 index 12ecb97..0000000 --- a/API.runner.js.md +++ /dev/null @@ -1,20 +0,0 @@ -# runner.js - -This document is auto-generated from the JSDoc comments in `src/store` by running `npm run api-doc`. - -## `runner.js.runner` - -*Source: `src/store/runner.js`* - -Resolves the object a store method should query through. Converted store modules call `runner(sql, params)` or `runner.query(sql, params)`. During the incremental migration they may still be constructed with a raw `mssql` pool, or called with a raw `mssql` Transaction as `tx`. This adapter exposes the unified runner contract over both so mixed call sites keep working until every module is converted. - -**Parameters** - -| Name | Type | Description | -| --- | --- | --- | -| `provider` | `import('../providers/provider.js').DatabaseProvider` | | -| `[tx]` | `object` | Optional provider runner or legacy mssql Transaction. | - -**Returns** - -`((sql: string, params?: object) => Promise) & { query: Function, dialect?: string }` diff --git a/generate-api-doc.js b/generate-api-doc.js index 745dad0..8decc2a 100644 --- a/generate-api-doc.js +++ b/generate-api-doc.js @@ -75,6 +75,7 @@ const INTERNAL_FILES = new Set([ 'shape.js', 'createStore.js', 'manifestLines.js', + 'runner.js', 'index.js', ]); @@ -321,6 +322,7 @@ function render() { } const SCHEMA_TABLES = [ + ['account', 'id PK, company_id->company, type:s(100), name:s(255)'], ['article', 'id PK, sku?:s(100) UQ, unit_id->unit, unitamount:f, weight:f, track_stock:b=1, brand_id?->brand, articlelist_id?->articlelist, optionslist_id?->optionslist, is_parent:b=0, parentarticle_id?->article, parentattributename_id?->attributename, parentsort:i=0, created_at:dt, updated_at:dt, UQ(parentarticle_id, parentsort)'], ['articleattributevalue', 'id PK, article_id->article, attributevalue_id->attributevalue, sort:i=0, UQ(article_id, attributevalue_id)'], ['articleean', 'id PK, article_id->article, ean:s(50) UQ'], @@ -331,6 +333,7 @@ const SCHEMA_TABLES = [ ['articleproperty', 'id PK, article_id->article, property_id->propertyname, value:txt, sort:i=0'], ['articlesupplier', 'id PK, article_id->article, entity_id->entity, net?:f, tax_id?->tax, sku?:s(100), stock?:f, pu:f=1, sort:i=0, UQ(article_id, entity_id), UQ(article_id, sort)'], ['articletext', 'id PK, article_id->article, language_id->language, name:s(255), slug:s(255), seo?:txt, desc?:txt, UQ(article_id, language_id)'], + ['articletombstone', 'id PK, company_id->company, article_id?:i, sku?:s(100), name?:s(255), taxrate?:d(18,4), net?:f, deleted_at:dt'], ['attributename', 'id PK, company_id->company, name:s(255), sort:i=0, exclusive:b=0, UQ(company_id, name)'], ['attributevalue', 'id PK, attribute_id->attributename, value:s(255), sort:i=0, UQ(attribute_id, value)'], ['attributevaluepic', 'id PK, attributevalue_id->attributevalue, pic_id->pic, sort:i=0, UQ(attributevalue_id, pic_id), UQ(attributevalue_id, sort)'], @@ -338,13 +341,16 @@ const SCHEMA_TABLES = [ ['brandpic', 'id PK, brand_id->brand, pic_id->pic, sort:i=0, UQ(brand_id, pic_id), UQ(brand_id, sort)'], ['category', 'id PK, parent_id?->category, sort:i=0'], ['categoryarticle', 'id PK, category_id->category, article_id->article, UQ(category_id, article_id)'], + ['categoryattributevalue', 'id PK, category_id->category, attributevalue_id->attributevalue, sort:i=0, UQ(category_id, attributevalue_id)'], ['categorypic', 'id PK, category_id->category, pic_id->pic, sort:i=0, UQ(category_id, pic_id), UQ(category_id, sort)'], + ['categoryproperty', 'id PK, category_id->category, property_id->propertyname, value:txt, sort:i=0'], ['categorytext', 'id PK, category_id->category, language_id->language, name:s(255), slug:s(255), seo?:txt, desc?:txt, UQ(category_id, language_id)'], ['company', 'id PK, name:s(255) UQ, root_category_id?->category, default_language_id?->language, taxrate?->tax, reducedtaxrate?->tax, taxfreerate?->tax, poscustomergroup_id->customergroup'], ['companyhistory', 'id PK, company_id->company, companyuser_id?->companyuser, date:dt, text:txt'], ['companysetting', 'id PK, company_id->company, key:s(255), value:txt, frontend:b=0, writeonly:b=0, UQ(company_id, key)'], ['companyuser', 'id PK, google_auth_id->google_auth, company_id->company, UQ(google_auth_id, company_id)'], ['customergroup', 'id PK, name:s(255), sort:i=0, company_id?->company'], + ['deliverysummary', 'id PK, company_id->company, manifest_id->manifest UQ, delivery_number:s(100), external_number?:s(100), delivery_date:dt, created_at:dt, supplier_id?->entity, supplier_name?:s(255), positions:i=0, gross_total:f=0, net_total:f=0, total_quantity:f=0, stock_positions:i=0, booked_positions:i=0, unbooked_positions:i=0, stock_quantity:f=0, booked_quantity:f=0, unbooked_quantity:f=0, is_booked:b=0'], ['entity', 'id PK, customergroup_id->customergroup, first_name?:s(255), name:s(255), number?:s(100), created_at:dt, updated_at:dt, UQ(company_id, number)'], ['entityaddress', 'id PK, entity_id->entity, first_name?:s(255), name?:s(255), street?:s(255), streetnumber?:s(50), zip?:s(50), city?:s(255), county?:s(255), addresstype:s(50), sort:i=0'], ['entitycontact', 'id PK, entity_id->entity, contacttype:s(50), contact:s(255), sort:i=0'], @@ -357,16 +363,29 @@ const SCHEMA_TABLES = [ ['manifest', 'id PK, company_id->company, number:s(100), type:s(100), entity_id?->entity, external_number?:s(100), date:dt, created_at:dt'], ['manifestarticle', 'id PK, manifest_id->manifest, sku?:s(100), name?:s(255), pu:f=1, amount:f, net:f, comment?:txt, rebate:f=0, taxrate:f=0'], ['manifestattachment', 'id PK, manifest_id->manifest, file_id->file, sort:i=0, UQ(manifest_id, sort)'], + ['mcp_auth_code', 'code:s(128) PK, client_id:s(100), google_auth_id->google_auth, redirect_uri:s(2048), code_challenge:s(255), code_challenge_method:s(32), scope?:s(255), expires_at:dt, used:b=0, created_at:dt'], + ['mcp_client', 'id PK, client_id:s(100) UQ, client_secret?:s(255), client_name:s(255), redirect_uris:txt, grant_types?:s(255), response_types?:s(255), scope?:s(255), created_at:dt'], + ['mcp_token', 'id PK, refresh_token:s(128) UQ, client_id:s(100), google_auth_id->google_auth, scope?:s(255), expires_at:dt, revoked:b=0, created_at:dt'], ['meta', 'key:s(255) PK, value:txt'], + ['modelconversation', 'id PK, companyuser_id->companyuser, provider:s(100), model:s(255), created_at:dt, updated_at:dt, state:s(20)=\'idle\', started_by?:i'], + ['modelmessage', 'id PK, conversation_id->modelconversation, created_at:dt, role:s(20), message:txt'], + ['modelvfs', 'id PK, company_id->company, name:s(255), mime:s(100), content:bin, meta?:txt, created_at:dt, updated_at:dt, UQ(company_id, name)'], ['numbers', 'id PK, company_id->company, type:s(100), prefix:s(50)=\'\', padding:i=0, next:i=1, UQ(company_id, type)'], ['optionslist', 'id PK'], ['optionslistarticle', 'id PK, optionslist_id->optionslist, article_id->article, count:i=1, sort:i=0, mandated:b=0, UQ(optionslist_id, article_id), UQ(optionslist_id, sort)'], + ['ordersummary', 'id PK, company_id->company, manifest_id->manifest UQ, order_number:s(100), order_date:dt, created_at:dt, entity_id?->entity, customer_name?:s(255), positions:i=0, gross_total:f=0, paid_total:f=0, ordered_quantity:f=0, shipped_quantity:f=0, is_paid:b=0, is_shipped:b=0'], + ['package', 'id PK, shipping_id->shipping, entityaddress_id->entityaddress, number:s(100), type:s(100), state:s(100), details?:txt'], + ['payment', 'id PK, account_id->account, manifest_id->manifest, type:s(100), amount:f'], ['pic', 'id PK, w:i, h:i, size:bi, hash:s(64) UQ, thumbw:i, thumbh:i, thumbhash:s(64), source:txt, fullbinary:bin, thumbbinary:bin'], ['posterminal', 'id PK, company_id->company, name:s(255), token?:s(255) UQ, pairingpin?:s(50), root_category_id?->category, sync_root_articles:b=1, lastseen_at?:dt, updated_at:dt'], ['posterminalcategory', 'id PK, posterminal_id->posterminal, category_id->category, UQ(posterminal_id, category_id)'], ['price', 'id PK, tax_id->tax, article_id->article, minmultiplier:d(18,4)=1, customergroup_id->customergroup, net:f'], ['printer', 'id PK, company_id->company, address:s(255), type:s(50), model?:s(255), serial?:s(255), sort:i=0, desc?:txt'], ['propertyname', 'id PK, company_id->company, name:s(255), sort:i=0, exclusive:b=0, UQ(company_id, name)'], + ['quotesummary', 'id PK, company_id->company, manifest_id->manifest UQ, quote_number:s(100), quote_date:dt, created_at:dt, entity_id?->entity, customer_name?:s(255), positions:i=0, gross_total:f=0, total_quantity:f=0'], + ['shipmentsummary', 'id PK, company_id->company, manifest_id->manifest UQ, shipment_number:s(100), shipment_date:dt, created_at:dt, order_id?:i, order_number?:s(100), entity_id?->entity, customer_name?:s(255), positions:i=0, total_quantity:f=0, package_count:i=0, carrier?:s(100), tracking_code?:s(255), state:s(50)=\'new\''], + ['shipping', 'id PK, manifest_id->manifest, number:s(100), tracking_code?:s(255), carrier?:s(100), type:s(100), state:s(100)'], + ['subagentschedule', 'id PK, company_id->company, desc?:txt, prompt:txt, skills?:txt, lastagentnote?:txt, max_itr:i=15, cron:s(100), created_at:dt, lastrun_at?:dt'], ['tax', 'id PK, rate:d(18,4) UQ'], ['unit', 'id PK, company_id->company, si:s(50), basesi:s(50), basesifactor:f, UQ(company_id, si)'], ['unittext', 'id PK, unit_id->unit, language_id->language, symbol:s(50), name:s(255), UQ(unit_id, language_id)'], diff --git a/generate-schema-graph.js b/generate-schema-graph.js index e0ab269..9a45186 100644 --- a/generate-schema-graph.js +++ b/generate-schema-graph.js @@ -394,7 +394,7 @@ const CLUSTERS = [ { id: 'ai', label: 'AI & Models', - tables: ['modelconversation', 'modelmessage', 'modelvfs'], + tables: ['modelconversation', 'modelmessage', 'modelvfs', 'subagentschedule'], }, { id: 'attributes', diff --git a/schema-graph.dot b/schema-graph.dot index f7dbb44..2bf0197 100644 --- a/schema-graph.dot +++ b/schema-graph.dot @@ -9,54 +9,54 @@ digraph schema { label="Identity & Company"; labeljust="l"; fontsize=15; style="rounded,filled"; fillcolor="#202a3a"; color="#3f4c5f"; fontcolor="#e2e8f0"; margin=14; - companyhistory [label=<
companyhistory
idINT PK
companyuser_id?INT FK
company_idINT FK
dateDATETIME2
textNVARCHAR(MAX)
>]; + customergroup [label=<
customergroup
idINT PK
company_id?INT FK
nameNVARCHAR(255)
sortINT
updated_atDATETIME2
>]; + company [label=<
company
idINT PK
root_category_id?INT FK
default_language_id?INT FK
taxrate?INT FK
reducedtaxrate?INT FK
taxfreerate?INT FK
poscustomergroup_idINT FK
nameNVARCHAR(255)
>]; meta [label=<
meta
keyNVARCHAR(255)
valueNVARCHAR(MAX)
>]; - numbers [label=<
numbers
idINT PK
company_idINT FK
typeNVARCHAR(100)
prefixNVARCHAR(50)
paddingINT
nextINT
>]; - companyuser [label=<
companyuser
idINT PK
google_auth_idINT FK
company_idINT FK
>]; + companyhistory [label=<
companyhistory
idINT PK
company_idINT FK
companyuser_id?INT FK
dateDATETIME2
textNVARCHAR(MAX)
>]; 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
>]; - companysetting [label=<
companysetting
idINT PK
company_idINT FK
keyNVARCHAR(255)
valueNVARCHAR(MAX)
frontendBIT
writeonlyBIT
>]; + numbers [label=<
numbers
idINT PK
company_idINT FK
typeNVARCHAR(100)
prefixNVARCHAR(50)
paddingINT
nextINT
>]; entity [label=<
entity
idINT PK
customergroup_idINT FK
first_name?NVARCHAR(255)
nameNVARCHAR(255)
number?NVARCHAR(100)
created_atDATETIME2
updated_atDATETIME2
>]; entitycontact [label=<
entitycontact
idINT PK
entity_idINT FK
contacttypeNVARCHAR(50)
contactNVARCHAR(255)
sortINT
>]; + companyuser [label=<
companyuser
idINT PK
company_idINT FK
google_auth_idINT FK
>]; + 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
writeonlyBIT
>]; google_auth [label=<
google_auth
idINT PK
selected_company?INT FK
emailNVARCHAR(320)
picture?NVARCHAR(2048)
picturebinary?VARBINARY(MAX)
sub?NVARCHAR(255)
created_atDATETIME2
>]; - company [label=<
company
idINT PK
poscustomergroup_idINT FK
default_language_id?INT FK
root_category_id?INT FK
taxrate?INT FK
reducedtaxrate?INT FK
taxfreerate?INT FK
nameNVARCHAR(255)
>]; - entityhistory [label=<
entityhistory
idINT PK
companyuser_id?INT FK
entity_idINT FK
dateDATETIME2
textNVARCHAR(MAX)
>]; - customergroup [label=<
customergroup
idINT PK
company_id?INT FK
nameNVARCHAR(255)
sortINT
updated_atDATETIME2
>]; } subgraph cluster_i18n { label="Localization"; labeljust="l"; fontsize=15; style="rounded,filled"; fillcolor="#202a3a"; color="#3f4c5f"; fontcolor="#e2e8f0"; margin=14; language [label=<
language
idINT PK
iso639NVARCHAR(10)
>]; + 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)
>]; unittext [label=<
unittext
idINT PK
language_idINT FK
unit_idINT FK
symbolNVARCHAR(50)
nameNVARCHAR(255)
>]; - categorytext [label=<
categorytext
idINT PK
language_idINT FK
category_idINT FK
nameNVARCHAR(255)
slugNVARCHAR(255)
seo?NVARCHAR(MAX)
desc?NVARCHAR(MAX)
>]; - articletext [label=<
articletext
idINT PK
language_idINT FK
article_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="#202a3a"; color="#3f4c5f"; fontcolor="#e2e8f0"; margin=14; - categoryarticle [label=<
categoryarticle
idINT PK
category_idINT FK
article_idINT FK
>]; - category [label=<
category
idINT PK
parent_id?INT FK
sortINT
updated_atDATETIME2
>]; - articlehistory [label=<
articlehistory
idINT PK
companyuser_id?INT FK
article_idINT FK
dateDATETIME2
textNVARCHAR(MAX)
meta?NVARCHAR(MAX)
>]; - article [label=<
article
idINT PK
company_idINT FK
parentattributename_id?INT FK
unit_idINT FK
parentarticle_id?INT FK
articlelist_id?INT FK
optionslist_id?INT FK
brand_id?INT FK
sku?NVARCHAR(100)
unitamountFLOAT
weightFLOAT
track_stockBIT
is_parentBIT
parentsortINT
created_atDATETIME2
updated_atDATETIME2
>]; - articleean [label=<
articleean
idINT PK
article_idINT FK
eanNVARCHAR(50)
>]; - articlesupplier [label=<
articlesupplier
idINT PK
entity_idINT FK
article_idINT FK
tax_id?INT FK
net?FLOAT
sku?NVARCHAR(100)
stock?FLOAT
puFLOAT
sortINT
>]; - articlelist [label=<
articlelist
idINT PK
>]; - articlelistarticle [label=<
articlelistarticle
idINT PK
article_idINT FK
articlelist_idINT FK
countINT
sortINT
>]; - optionslist [label=<
optionslist
idINT PK
>]; - optionslistarticle [label=<
optionslistarticle
idINT PK
article_idINT FK
optionslist_idINT FK
countINT
sortINT
mandatedBIT
>]; brand [label=<
brand
idINT PK
company_idINT FK
nameNVARCHAR(255)
gsprpinfo?NVARCHAR(MAX)
>]; articletombstone [label=<
articletombstone
idINT PK
company_idINT FK
article_id?INT
sku?NVARCHAR(100)
name?NVARCHAR(255)
taxrate?DECIMAL(18,4)
net?FLOAT
deleted_atDATETIME2
>]; + articlelist [label=<
articlelist
idINT PK
>]; + articlelistarticle [label=<
articlelistarticle
idINT PK
articlelist_idINT FK
article_idINT FK
countINT
sortINT
>]; + optionslist [label=<
optionslist
idINT PK
>]; + optionslistarticle [label=<
optionslistarticle
idINT PK
optionslist_idINT FK
article_idINT FK
countINT
sortINT
mandatedBIT
>]; + articlehistory [label=<
articlehistory
idINT PK
article_idINT FK
companyuser_id?INT FK
dateDATETIME2
textNVARCHAR(MAX)
meta?NVARCHAR(MAX)
>]; + articleean [label=<
articleean
idINT PK
article_idINT FK
eanNVARCHAR(50)
>]; + article [label=<
article
idINT PK
brand_id?INT FK
articlelist_id?INT FK
optionslist_id?INT FK
parentarticle_id?INT FK
unit_idINT FK
parentattributename_id?INT FK
company_idINT FK
sku?NVARCHAR(100)
unitamountFLOAT
weightFLOAT
track_stockBIT
is_parentBIT
parentsortINT
created_atDATETIME2
updated_atDATETIME2
>]; + articlesupplier [label=<
articlesupplier
idINT PK
article_idINT FK
tax_id?INT FK
entity_idINT FK
net?FLOAT
sku?NVARCHAR(100)
stock?FLOAT
puFLOAT
sortINT
>]; + category [label=<
category
idINT PK
parent_id?INT FK
sortINT
updated_atDATETIME2
>]; + categoryarticle [label=<
categoryarticle
idINT PK
article_idINT FK
category_idINT FK
>]; } subgraph cluster_media { label="Media"; labeljust="l"; fontsize=15; style="rounded,filled"; fillcolor="#202a3a"; color="#3f4c5f"; fontcolor="#e2e8f0"; margin=14; pic [label=<
pic
idINT PK
wINT
hINT
sizeBIGINT
hashNVARCHAR(64)
thumbwINT
thumbhINT
thumbhashNVARCHAR(64)
smallthumbwINT
smallthumbhINT
sourceNVARCHAR(MAX)
fullbinaryVARBINARY(MAX)
thumbbinaryVARBINARY(MAX)
smallthumbbinaryVARBINARY(MAX)
>]; - attributevaluepic [label=<
attributevaluepic
idINT PK
attributevalue_idINT FK
pic_idINT FK
sortINT
>]; + brandpic [label=<
brandpic
idINT PK
brand_idINT FK
pic_idINT FK
sortINT
>]; + articlepic [label=<
articlepic
idINT PK
article_idINT FK
pic_idINT FK
sortINT
>]; categorypic [label=<
categorypic
idINT PK
pic_idINT FK
category_idINT FK
sortINT
>]; - articlepic [label=<
articlepic
idINT PK
pic_idINT FK
article_idINT FK
sortINT
>]; - brandpic [label=<
brandpic
idINT PK
pic_idINT FK
brand_idINT FK
sortINT
>]; + attributevaluepic [label=<
attributevaluepic
idINT PK
pic_idINT FK
attributevalue_idINT FK
sortINT
>]; file [label=<
file
idINT PK
hashNVARCHAR(64)
mimetypeNVARCHAR(255)
nameNVARCHAR(255)
sizeBIGINT
createdDATETIME2
modifiedDATETIME2
contentVARBINARY(MAX)
thumbavif?VARBINARY(MAX)
thumbx?INT
thumby?INT
meta?NVARCHAR(MAX)
>]; } subgraph cluster_manifests { @@ -64,23 +64,23 @@ digraph schema { style="rounded,filled"; fillcolor="#202a3a"; color="#3f4c5f"; fontcolor="#e2e8f0"; margin=14; manifestattachment [label=<
manifestattachment
idINT PK
file_idINT FK
manifest_idINT FK
sortINT
>]; - package [label=<
package
idINT PK
entityaddress_idINT FK
shipping_idINT FK
numberNVARCHAR(100)
typeNVARCHAR(100)
stateNVARCHAR(100)
details?NVARCHAR(MAX)
>]; - manifest [label=<
manifest
idINT PK
entity_id?INT FK
company_idINT FK
numberNVARCHAR(100)
typeNVARCHAR(100)
external_number?NVARCHAR(100)
dateDATETIME2
created_atDATETIME2
>]; - manifestarticle [label=<
manifestarticle
idINT PK
manifest_idINT FK
sku?NVARCHAR(100)
name?NVARCHAR(255)
puFLOAT
amountFLOAT
netFLOAT
comment?NVARCHAR(MAX)
rebateFLOAT
taxrateFLOAT
>]; ledger [label=<
ledger
idINT PK
manifestarticle_idINT FK
warehouse_id?INT FK
transaction_typeNVARCHAR(100)
amountFLOAT
transaction_textNVARCHAR(MAX)
hash_versionINT
prev_hash?NVARCHAR(128)
created_atDATETIME2
>]; - shipping [label=<
shipping
idINT PK
manifest_idINT FK
numberNVARCHAR(100)
tracking_code?NVARCHAR(255)
carrier?NVARCHAR(100)
typeNVARCHAR(100)
stateNVARCHAR(100)
>]; - shipmentsummary [label=<
shipmentsummary
idINT PK
entity_id?INT FK
company_idINT FK
manifest_idINT FK
shipment_numberNVARCHAR(100)
shipment_dateDATETIME2
created_atDATETIME2
order_id?INT
order_number?NVARCHAR(100)
customer_name?NVARCHAR(255)
positionsINT
total_quantityFLOAT
package_countINT
carrier?NVARCHAR(100)
tracking_code?NVARCHAR(255)
stateNVARCHAR(50)
>]; + manifest [label=<
manifest
idINT PK
company_idINT FK
entity_id?INT FK
numberNVARCHAR(100)
typeNVARCHAR(100)
external_number?NVARCHAR(100)
dateDATETIME2
created_atDATETIME2
>]; + manifestarticle [label=<
manifestarticle
idINT PK
manifest_idINT FK
sku?NVARCHAR(100)
name?NVARCHAR(255)
puFLOAT
amountFLOAT
netFLOAT
comment?NVARCHAR(MAX)
rebateFLOAT
taxrateFLOAT
>]; warehouse [label=<
warehouse
idINT PK
company_idINT FK
nameNVARCHAR(255)
sortINT
>]; - deliverysummary [label=<
deliverysummary
idINT PK
supplier_id?INT FK
company_idINT FK
manifest_idINT FK
delivery_numberNVARCHAR(100)
external_number?NVARCHAR(100)
delivery_dateDATETIME2
created_atDATETIME2
supplier_name?NVARCHAR(255)
positionsINT
gross_totalFLOAT
net_totalFLOAT
total_quantityFLOAT
stock_positionsINT
booked_positionsINT
unbooked_positionsINT
stock_quantityFLOAT
booked_quantityFLOAT
unbooked_quantityFLOAT
is_bookedTINYINT
>]; - ordersummary [label=<
ordersummary
idINT PK
entity_id?INT FK
company_idINT FK
manifest_idINT FK
order_numberNVARCHAR(100)
order_dateDATETIME2
created_atDATETIME2
customer_name?NVARCHAR(255)
positionsINT
gross_totalFLOAT
paid_totalFLOAT
ordered_quantityFLOAT
shipped_quantityFLOAT
is_paidTINYINT
is_shippedTINYINT
>]; - quotesummary [label=<
quotesummary
idINT PK
entity_id?INT FK
company_idINT FK
manifest_idINT FK
quote_numberNVARCHAR(100)
quote_dateDATETIME2
created_atDATETIME2
customer_name?NVARCHAR(255)
positionsINT
gross_totalFLOAT
total_quantityFLOAT
>]; + quotesummary [label=<
quotesummary
idINT PK
manifest_idINT FK
company_idINT FK
entity_id?INT FK
quote_numberNVARCHAR(100)
quote_dateDATETIME2
created_atDATETIME2
customer_name?NVARCHAR(255)
positionsINT
gross_totalFLOAT
total_quantityFLOAT
>]; + shipping [label=<
shipping
idINT PK
manifest_idINT FK
numberNVARCHAR(100)
tracking_code?NVARCHAR(255)
carrier?NVARCHAR(100)
typeNVARCHAR(100)
stateNVARCHAR(100)
>]; + shipmentsummary [label=<
shipmentsummary
idINT PK
manifest_idINT FK
company_idINT FK
entity_id?INT FK
shipment_numberNVARCHAR(100)
shipment_dateDATETIME2
created_atDATETIME2
order_id?INT
order_number?NVARCHAR(100)
customer_name?NVARCHAR(255)
positionsINT
total_quantityFLOAT
package_countINT
carrier?NVARCHAR(100)
tracking_code?NVARCHAR(255)
stateNVARCHAR(50)
>]; + deliverysummary [label=<
deliverysummary
idINT PK
manifest_idINT FK
company_idINT FK
supplier_id?INT FK
delivery_numberNVARCHAR(100)
external_number?NVARCHAR(100)
delivery_dateDATETIME2
created_atDATETIME2
supplier_name?NVARCHAR(255)
positionsINT
gross_totalFLOAT
net_totalFLOAT
total_quantityFLOAT
stock_positionsINT
booked_positionsINT
unbooked_positionsINT
stock_quantityFLOAT
booked_quantityFLOAT
unbooked_quantityFLOAT
is_bookedTINYINT
>]; + package [label=<
package
idINT PK
shipping_idINT FK
entityaddress_idINT FK
numberNVARCHAR(100)
typeNVARCHAR(100)
stateNVARCHAR(100)
details?NVARCHAR(MAX)
>]; + ordersummary [label=<
ordersummary
idINT PK
manifest_idINT FK
company_idINT FK
entity_id?INT FK
order_numberNVARCHAR(100)
order_dateDATETIME2
created_atDATETIME2
customer_name?NVARCHAR(255)
positionsINT
gross_totalFLOAT
paid_totalFLOAT
ordered_quantityFLOAT
shipped_quantityFLOAT
is_paidTINYINT
is_shippedTINYINT
>]; } subgraph cluster_commerce { label="Pricing & Payments"; labeljust="l"; fontsize=15; style="rounded,filled"; fillcolor="#202a3a"; color="#3f4c5f"; fontcolor="#e2e8f0"; margin=14; tax [label=<
tax
idINT PK
rateDECIMAL(18,4)
>]; - price [label=<
price
idINT PK
customergroup_idINT FK
article_idINT FK
tax_idINT FK
minmultiplierDECIMAL(18,4)
netFLOAT
>]; + price [label=<
price
idINT PK
article_idINT FK
tax_idINT FK
customergroup_idINT FK
minmultiplierDECIMAL(18,4)
netFLOAT
>]; account [label=<
account
idINT PK
company_idINT FK
typeNVARCHAR(100)
nameNVARCHAR(255)
>]; payment [label=<
payment
idINT PK
account_idINT FK
manifest_idINT FK
typeNVARCHAR(100)
amountFLOAT
>]; } @@ -95,7 +95,7 @@ digraph schema { style="rounded,filled"; fillcolor="#202a3a"; color="#3f4c5f"; fontcolor="#e2e8f0"; margin=14; posterminalcategory [label=<
posterminalcategory
idINT PK
category_idINT FK
posterminal_idINT FK
>]; - posterminal [label=<
posterminal
idINT PK
company_idINT FK
root_category_id?INT FK
nameNVARCHAR(255)
token?NVARCHAR(255)
pairingpin?NVARCHAR(50)
paired_at?DATETIME2
clientserial?NVARCHAR(255)
maxknowntombstoneid?INT
sync_root_articlesBIT
lastseen_at?DATETIME2
updated_atDATETIME2
>]; + posterminal [label=<
posterminal
idINT PK
root_category_id?INT FK
company_idINT FK
nameNVARCHAR(255)
token?NVARCHAR(255)
pairingpin?NVARCHAR(50)
paired_at?DATETIME2
clientserial?NVARCHAR(255)
maxknowntombstoneid?INT
sync_root_articlesBIT
lastseen_at?DATETIME2
updated_atDATETIME2
>]; printer [label=<
printer
idINT PK
company_idINT FK
addressNVARCHAR(255)
typeNVARCHAR(50)
model?NVARCHAR(255)
serial?NVARCHAR(255)
sortINT
desc?NVARCHAR(MAX)
>]; labeltemplate [label=<
labeltemplate
idINT PK
company_idINT FK
nameNVARCHAR(255)
widthINT
heightINT
dpiINT
typeNVARCHAR(50)
contentNVARCHAR(MAX)
thumb?VARBINARY(MAX)
>]; } @@ -111,126 +111,128 @@ digraph schema { label="Properties & Attributes"; labeljust="l"; fontsize=15; style="rounded,filled"; fillcolor="#202a3a"; color="#3f4c5f"; fontcolor="#e2e8f0"; margin=14; - propertyname [label=<
propertyname
idINT PK
company_idINT FK
nameNVARCHAR(255)
sortINT
exclusiveBIT
>]; - attributename [label=<
attributename
idINT PK
company_idINT FK
nameNVARCHAR(255)
sortINT
exclusiveBIT
>]; + articleproperty [label=<
articleproperty
idINT PK
article_idINT FK
property_idINT FK
valueNVARCHAR(MAX)
sortINT
>]; + articleattributevalue [label=<
articleattributevalue
idINT PK
article_idINT FK
attributevalue_idINT FK
sortINT
>]; + categoryproperty [label=<
categoryproperty
idINT PK
category_idINT FK
property_idINT FK
valueNVARCHAR(MAX)
sortINT
>]; + categoryattributevalue [label=<
categoryattributevalue
idINT PK
category_idINT FK
attributevalue_idINT FK
sortINT
>]; attributevalue [label=<
attributevalue
idINT PK
attribute_idINT FK
valueNVARCHAR(255)
sortINT
>]; - categoryproperty [label=<
categoryproperty
idINT PK
property_idINT FK
category_idINT FK
valueNVARCHAR(MAX)
sortINT
>]; - categoryattributevalue [label=<
categoryattributevalue
idINT PK
attributevalue_idINT FK
category_idINT FK
sortINT
>]; - articleproperty [label=<
articleproperty
idINT PK
property_idINT FK
article_idINT FK
valueNVARCHAR(MAX)
sortINT
>]; - articleattributevalue [label=<
articleattributevalue
idINT PK
attributevalue_idINT FK
article_idINT FK
sortINT
>]; + attributename [label=<
attributename
idINT PK
company_idINT FK
nameNVARCHAR(255)
sortINT
exclusiveBIT
>]; + propertyname [label=<
propertyname
idINT PK
company_idINT FK
nameNVARCHAR(255)
sortINT
exclusiveBIT
>]; } + mcp_client [label=<
mcp_client
idINT PK
client_idNVARCHAR(100)
client_secret?NVARCHAR(255)
client_nameNVARCHAR(255)
redirect_urisNVARCHAR(MAX)
grant_types?NVARCHAR(255)
response_types?NVARCHAR(255)
scope?NVARCHAR(255)
created_atDATETIME2
>]; mcp_token [label=<
mcp_token
idINT PK
google_auth_idINT FK
refresh_tokenNVARCHAR(128)
client_idNVARCHAR(100)
scope?NVARCHAR(255)
expires_atDATETIME2
revokedTINYINT
created_atDATETIME2
>]; mcp_auth_code [label=<
mcp_auth_code
codeNVARCHAR(128) PK
google_auth_idINT FK
client_idNVARCHAR(100)
redirect_uriNVARCHAR(2048)
code_challengeNVARCHAR(255)
code_challenge_methodNVARCHAR(32)
scope?NVARCHAR(255)
expires_atDATETIME2
usedTINYINT
created_atDATETIME2
>]; - mcp_client [label=<
mcp_client
idINT PK
client_idNVARCHAR(100)
client_secret?NVARCHAR(255)
client_nameNVARCHAR(255)
redirect_urisNVARCHAR(MAX)
grant_types?NVARCHAR(255)
response_types?NVARCHAR(255)
scope?NVARCHAR(255)
created_atDATETIME2
>]; + subagentschedule [label=<
subagentschedule
idINT PK
company_idINT FK
desc?NVARCHAR(MAX)
promptNVARCHAR(MAX)
skills?NVARCHAR(MAX)
lastagentnote?NVARCHAR(MAX)
max_itrINT
cronNVARCHAR(100)
created_atDATETIME2
lastrun_at?DATETIME2
>]; __legend [label=<
Legend
PKprimary key
FKforeign key
?nullable column
—FOREIGN KEY constraint
- -naming convention only, no constraint
>]; - google_auth:selected_company:se -> company:in3:n [color="#ff6b6b", fontcolor="#ff6b6b", tooltip="FK_google_auth_selected_company", weight=3]; + google_auth:selected_company:w -> company:in22:n [color="#ff6b6b", fontcolor="#ff6b6b", tooltip="FK_google_auth_selected_company", weight=3]; category:parent_id:e -> category:id:e [color="#6bdf9a", fontcolor="#6bdf9a", tooltip="FK_category_parent", constraint=false]; - company:root_category_id:e -> category:in0:n [color="#5aa7ff", fontcolor="#5aa7ff", tooltip="FK_company_root_category", weight=3]; - company:default_language_id:w -> language:in0:n [color="#f5c15c", fontcolor="#f5c15c", tooltip="FK_company_default_language", constraint=false, weight=1]; - company:taxrate:e -> tax:in2:n [color="#c79bff", fontcolor="#c79bff", tooltip="FK_company_taxrate", constraint=false, weight=1]; - company:reducedtaxrate:e -> tax:in0:n [color="#ff9f5a", fontcolor="#ff9f5a", tooltip="FK_company_reducedtaxrate", constraint=false, weight=1]; - company:taxfreerate:e -> tax:in1:n [color="#5cd6d6", fontcolor="#5cd6d6", tooltip="FK_company_taxfreerate", constraint=false, weight=1]; - customergroup:company_id:sw -> company:in6:n [color="#ff7fc2", fontcolor="#ff7fc2", tooltip="FK_customergroup_company", weight=3]; - company:poscustomergroup_id:ne -> customergroup:in1:n [color="#8f95ff", fontcolor="#8f95ff", tooltip="FK_company_poscustomergroup", constraint=false, weight=1]; - entity:customergroup_id:se -> customergroup:in0:n [color="#58d18a", fontcolor="#58d18a", tooltip="FK_entity_customergroup", weight=3]; - entityaddress:entity_id:se -> entity:in0:n [color="#ff8f66", fontcolor="#ff8f66", tooltip="FK_entityaddress_entity", weight=3]; - entitycontact:entity_id:se -> entity:in1:n [color="#4fc4e8", fontcolor="#4fc4e8", tooltip="FK_entitycontact_entity", weight=3]; - entityhistory:entity_id:ne -> entity:in2:n [color="#a98cff", fontcolor="#a98cff", tooltip="FK_entityhistory_entity", weight=3]; - entityhistory:companyuser_id:se -> companyuser:in2:n [color="#ff6f6f", fontcolor="#ff6f6f", tooltip="FK_entityhistory_companyuser", constraint=false, weight=1]; - unit:company_id:w -> company:in9:n [color="#4ecb8f", fontcolor="#4ecb8f", tooltip="FK_unit_company", weight=3]; - unittext:unit_id:se -> unit:in0:n [color="#5aa7e6", fontcolor="#5aa7e6", tooltip="FK_unittext_unit", weight=3]; - unittext:language_id:w -> language:in1:n [color="#ff7aa8", fontcolor="#ff7aa8", tooltip="FK_unittext_language", constraint=false, weight=1]; - brand:company_id:w -> company:in11:n [color="#e0b25a", fontcolor="#e0b25a", tooltip="FK_brand_company", weight=3]; - article:company_id:w -> company:in10:n [color="#56c8c8", fontcolor="#56c8c8", tooltip="FK_article_company", weight=3]; - article:unit_id:w -> unit:in1:n [color="#ff5f9e", fontcolor="#ff5f9e", tooltip="FK_article_unit", constraint=false, weight=1]; - article:brand_id:e -> brand:in1:n [color="#ffb25a", fontcolor="#ffb25a", tooltip="FK_article_brand", constraint=false, weight=1]; - article:articlelist_id:e -> articlelist:in0:n [color="#56d68a", fontcolor="#56d68a", tooltip="FK_article_articlelist", constraint=false, weight=1]; - article:optionslist_id:e -> optionslist:in0:n [color="#66b3ff", fontcolor="#66b3ff", tooltip="FK_article_optionslist", constraint=false, weight=1]; + company:root_category_id:w -> category:in8:n [color="#5aa7ff", fontcolor="#5aa7ff", tooltip="FK_company_root_category", weight=3]; + company:default_language_id:w -> language:in1:n [color="#f5c15c", fontcolor="#f5c15c", tooltip="FK_company_default_language", constraint=false, weight=1]; + company:taxrate:w -> tax:in4:n [color="#c79bff", fontcolor="#c79bff", tooltip="FK_company_taxrate", constraint=false, weight=1]; + company:reducedtaxrate:w -> tax:in2:n [color="#ff9f5a", fontcolor="#ff9f5a", tooltip="FK_company_reducedtaxrate", constraint=false, weight=1]; + company:taxfreerate:w -> tax:in3:n [color="#5cd6d6", fontcolor="#5cd6d6", tooltip="FK_company_taxfreerate", constraint=false, weight=1]; + customergroup:company_id:ne -> company:in17:n [color="#ff7fc2", fontcolor="#ff7fc2", tooltip="FK_customergroup_company", weight=3]; + company:poscustomergroup_id:se -> customergroup:in1:n [color="#8f95ff", fontcolor="#8f95ff", tooltip="FK_company_poscustomergroup", constraint=false, weight=1]; + entity:customergroup_id:sw -> customergroup:in2:n [color="#58d18a", fontcolor="#58d18a", tooltip="FK_entity_customergroup", weight=3]; + entityaddress:entity_id:ne -> entity:in7:n [color="#ff8f66", fontcolor="#ff8f66", tooltip="FK_entityaddress_entity", weight=3]; + entitycontact:entity_id:sw -> entity:in6:n [color="#4fc4e8", fontcolor="#4fc4e8", tooltip="FK_entitycontact_entity", weight=3]; + entityhistory:entity_id:sw -> entity:in8:n [color="#a98cff", fontcolor="#a98cff", tooltip="FK_entityhistory_entity", weight=3]; + entityhistory:companyuser_id:se -> companyuser:in3:n [color="#ff6f6f", fontcolor="#ff6f6f", tooltip="FK_entityhistory_companyuser", constraint=false, weight=1]; + unit:company_id:w -> company:in3:n [color="#4ecb8f", fontcolor="#4ecb8f", tooltip="FK_unit_company", weight=3]; + unittext:unit_id:se -> unit:in1:n [color="#5aa7e6", fontcolor="#5aa7e6", tooltip="FK_unittext_unit", weight=3]; + unittext:language_id:w -> language:in3:n [color="#ff7aa8", fontcolor="#ff7aa8", tooltip="FK_unittext_language", constraint=false, weight=1]; + brand:company_id:e -> company:in0:n [color="#e0b25a", fontcolor="#e0b25a", tooltip="FK_brand_company", weight=3]; + article:company_id:e -> company:in2:n [color="#56c8c8", fontcolor="#56c8c8", tooltip="FK_article_company", weight=3]; + article:unit_id:e -> unit:in0:n [color="#ff5f9e", fontcolor="#ff5f9e", tooltip="FK_article_unit", constraint=false, weight=1]; + article:brand_id:w -> brand:in0:n [color="#ffb25a", fontcolor="#ffb25a", tooltip="FK_article_brand", constraint=false, weight=1]; + article:articlelist_id:w -> articlelist:in1:n [color="#56d68a", fontcolor="#56d68a", tooltip="FK_article_articlelist", constraint=false, weight=1]; + article:optionslist_id:w -> optionslist:in1:n [color="#66b3ff", fontcolor="#66b3ff", tooltip="FK_article_optionslist", constraint=false, weight=1]; article:parentarticle_id:e -> article:id:e [color="#c79bff", fontcolor="#c79bff", tooltip="FK_article_parentarticle", constraint=false]; - article:parentattributename_id:sw -> attributename:in2:n [color="#ff6b6b", fontcolor="#ff6b6b", tooltip="FK_article_parentattributename", constraint=false, weight=1]; - article:parentattributename_id:sw -> attributename:in2:n [color="#ff6b6b", fontcolor="#ff6b6b", tooltip="FK_article_parentattributename", constraint=false, weight=1]; - articlehistory:article_id:se -> article:in5:n [color="#6bdf9a", fontcolor="#6bdf9a", tooltip="FK_articlehistory_article", weight=3]; - articlehistory:companyuser_id:w -> companyuser:in3:n [color="#5aa7ff", fontcolor="#5aa7ff", tooltip="FK_articlehistory_companyuser", constraint=false, weight=1]; - companyhistory:company_id:e -> company:in2:n [color="#f5c15c", fontcolor="#f5c15c", tooltip="FK_companyhistory_company", weight=3]; - companyhistory:companyuser_id:e -> companyuser:in1:n [color="#c79bff", fontcolor="#c79bff", tooltip="FK_companyhistory_companyuser", constraint=false, weight=1]; - articletombstone:company_id:e -> company:in12:n [color="#ff9f5a", fontcolor="#ff9f5a", tooltip="FK_articletombstone_company", weight=3]; - articleean:article_id:sw -> article:in7:n [color="#5cd6d6", fontcolor="#5cd6d6", tooltip="FK_articleean_article", weight=3]; - articlepic:article_id:se -> article:in3:n [color="#ff7fc2", fontcolor="#ff7fc2", tooltip="FK_articlepic_article", weight=3]; - articlepic:pic_id:w -> pic:in2:n [color="#8f95ff", fontcolor="#8f95ff", tooltip="FK_articlepic_pic", constraint=false, weight=1]; - brandpic:brand_id:e -> brand:in0:n [color="#58d18a", fontcolor="#58d18a", tooltip="FK_brandpic_brand", weight=3]; - brandpic:pic_id:w -> pic:in3:n [color="#ff8f66", fontcolor="#ff8f66", tooltip="FK_brandpic_pic", constraint=false, weight=1]; - attributevaluepic:attributevalue_id:e -> attributevalue:in2:n [color="#4fc4e8", fontcolor="#4fc4e8", tooltip="FK_attributevaluepic_attributevalue", weight=3]; - attributevaluepic:pic_id:w -> pic:in1:n [color="#a98cff", fontcolor="#a98cff", tooltip="FK_attributevaluepic_pic", constraint=false, weight=1]; - articlelistarticle:articlelist_id:se -> articlelist:in1:n [color="#ff6f6f", fontcolor="#ff6f6f", tooltip="FK_articlelistarticle_articlelist", weight=3]; - articlelistarticle:article_id:e -> article:in9:n [color="#4ecb8f", fontcolor="#4ecb8f", tooltip="FK_articlelistarticle_article", constraint=false, weight=1]; - optionslistarticle:optionslist_id:sw -> optionslist:in1:n [color="#5aa7e6", fontcolor="#5aa7e6", tooltip="FK_optionslistarticle_optionslist", weight=3]; - optionslistarticle:article_id:e -> article:in11:n [color="#ff7aa8", fontcolor="#ff7aa8", tooltip="FK_optionslistarticle_article", constraint=false, weight=1]; - categoryarticle:category_id:se -> category:in5:n [color="#e0b25a", fontcolor="#e0b25a", tooltip="FK_categoryarticle_category", weight=3]; - categoryarticle:article_id:se -> article:in4:n [color="#56c8c8", fontcolor="#56c8c8", tooltip="FK_categoryarticle_article", constraint=false, weight=1]; - categorypic:category_id:se -> category:in4:n [color="#ff5f9e", fontcolor="#ff5f9e", tooltip="FK_categorypic_category", weight=3]; - categorypic:pic_id:w -> pic:in0:n [color="#ffb25a", fontcolor="#ffb25a", tooltip="FK_categorypic_pic", constraint=false, weight=1]; - categorytext:category_id:e -> category:in2:n [color="#56d68a", fontcolor="#56d68a", tooltip="FK_categorytext_category", weight=3]; - categorytext:language_id:e -> language:in2:n [color="#66b3ff", fontcolor="#66b3ff", tooltip="FK_categorytext_language", constraint=false, weight=1]; - articletext:article_id:e -> article:in2:n [color="#c79bff", fontcolor="#c79bff", tooltip="FK_articletext_article", weight=3]; - articletext:language_id:w -> language:in3:n [color="#ff6b6b", fontcolor="#ff6b6b", tooltip="FK_articletext_language", constraint=false, weight=1]; - price:tax_id:w -> tax:in4:n [color="#6bdf9a", fontcolor="#6bdf9a", tooltip="FK_price_tax", constraint=false, weight=1]; - price:article_id:e -> article:in10:n [color="#5aa7ff", fontcolor="#5aa7ff", tooltip="FK_price_article", weight=3]; - price:customergroup_id:e -> customergroup:in2:n [color="#f5c15c", fontcolor="#f5c15c", tooltip="FK_price_customergroup", constraint=false, weight=1]; - articlesupplier:article_id:sw -> article:in8:n [color="#c79bff", fontcolor="#c79bff", tooltip="FK_articlesupplier_article", weight=3]; - articlesupplier:entity_id:w -> entity:in5:n [color="#ff9f5a", fontcolor="#ff9f5a", tooltip="FK_articlesupplier_entity", constraint=false, weight=1]; - articlesupplier:tax_id:e -> tax:in3:n [color="#5cd6d6", fontcolor="#5cd6d6", tooltip="FK_articlesupplier_tax", constraint=false, weight=1]; - manifest:company_id:w -> company:in17:n [color="#ff7fc2", fontcolor="#ff7fc2", tooltip="FK_manifest_company", weight=3]; - manifest:entity_id:w -> entity:in3:n [color="#8f95ff", fontcolor="#8f95ff", tooltip="FK_manifest_entity", constraint=false, weight=1]; + article:parentattributename_id:se -> attributename:in1:n [color="#ff6b6b", fontcolor="#ff6b6b", tooltip="FK_article_parentattributename", constraint=false, weight=1]; + article:parentattributename_id:se -> attributename:in1:n [color="#ff6b6b", fontcolor="#ff6b6b", tooltip="FK_article_parentattributename", constraint=false, weight=1]; + articlehistory:article_id:se -> article:in2:n [color="#6bdf9a", fontcolor="#6bdf9a", tooltip="FK_articlehistory_article", weight=3]; + articlehistory:companyuser_id:e -> companyuser:in0:n [color="#5aa7ff", fontcolor="#5aa7ff", tooltip="FK_articlehistory_companyuser", constraint=false, weight=1]; + companyhistory:company_id:sw -> company:in19:n [color="#f5c15c", fontcolor="#f5c15c", tooltip="FK_companyhistory_company", weight=3]; + companyhistory:companyuser_id:e -> companyuser:in2:n [color="#c79bff", fontcolor="#c79bff", tooltip="FK_companyhistory_companyuser", constraint=false, weight=1]; + articletombstone:company_id:e -> company:in1:n [color="#ff9f5a", fontcolor="#ff9f5a", tooltip="FK_articletombstone_company", weight=3]; + articleean:article_id:ne -> article:in3:n [color="#5cd6d6", fontcolor="#5cd6d6", tooltip="FK_articleean_article", weight=3]; + articlepic:article_id:se -> article:in6:n [color="#ff7fc2", fontcolor="#ff7fc2", tooltip="FK_articlepic_article", weight=3]; + articlepic:pic_id:w -> pic:in0:n [color="#8f95ff", fontcolor="#8f95ff", tooltip="FK_articlepic_pic", constraint=false, weight=1]; + brandpic:brand_id:w -> brand:in1:n [color="#58d18a", fontcolor="#58d18a", tooltip="FK_brandpic_brand", weight=3]; + brandpic:pic_id:w -> pic:in1:n [color="#ff8f66", fontcolor="#ff8f66", tooltip="FK_brandpic_pic", constraint=false, weight=1]; + attributevaluepic:attributevalue_id:e -> attributevalue:in0:n [color="#4fc4e8", fontcolor="#4fc4e8", tooltip="FK_attributevaluepic_attributevalue", weight=3]; + attributevaluepic:pic_id:w -> pic:in3:n [color="#a98cff", fontcolor="#a98cff", tooltip="FK_attributevaluepic_pic", constraint=false, weight=1]; + articlelistarticle:articlelist_id:nw -> articlelist:in0:n [color="#ff6f6f", fontcolor="#ff6f6f", tooltip="FK_articlelistarticle_articlelist", weight=3]; + articlelistarticle:article_id:w -> article:in0:n [color="#4ecb8f", fontcolor="#4ecb8f", tooltip="FK_articlelistarticle_article", constraint=false, weight=1]; + optionslistarticle:optionslist_id:sw -> optionslist:in0:n [color="#5aa7e6", fontcolor="#5aa7e6", tooltip="FK_optionslistarticle_optionslist", weight=3]; + optionslistarticle:article_id:e -> article:in1:n [color="#ff7aa8", fontcolor="#ff7aa8", tooltip="FK_optionslistarticle_article", constraint=false, weight=1]; + categoryarticle:category_id:nw -> category:in1:n [color="#e0b25a", fontcolor="#e0b25a", tooltip="FK_categoryarticle_category", weight=3]; + categoryarticle:article_id:sw -> article:in7:n [color="#56c8c8", fontcolor="#56c8c8", tooltip="FK_categoryarticle_article", constraint=false, weight=1]; + categorypic:category_id:sw -> category:in2:n [color="#ff5f9e", fontcolor="#ff5f9e", tooltip="FK_categorypic_category", weight=3]; + categorypic:pic_id:w -> pic:in2:n [color="#ffb25a", fontcolor="#ffb25a", tooltip="FK_categorypic_pic", constraint=false, weight=1]; + categorytext:category_id:e -> category:in3:n [color="#56d68a", fontcolor="#56d68a", tooltip="FK_categorytext_category", weight=3]; + categorytext:language_id:w -> language:in0:n [color="#66b3ff", fontcolor="#66b3ff", tooltip="FK_categorytext_language", constraint=false, weight=1]; + articletext:article_id:e -> article:in8:n [color="#c79bff", fontcolor="#c79bff", tooltip="FK_articletext_article", weight=3]; + articletext:language_id:w -> language:in2:n [color="#ff6b6b", fontcolor="#ff6b6b", tooltip="FK_articletext_language", constraint=false, weight=1]; + price:tax_id:e -> tax:in1:n [color="#6bdf9a", fontcolor="#6bdf9a", tooltip="FK_price_tax", constraint=false, weight=1]; + price:article_id:w -> article:in11:n [color="#5aa7ff", fontcolor="#5aa7ff", tooltip="FK_price_article", weight=3]; + price:customergroup_id:e -> customergroup:in0:n [color="#f5c15c", fontcolor="#f5c15c", tooltip="FK_price_customergroup", constraint=false, weight=1]; + articlesupplier:article_id:sw -> article:in5:n [color="#c79bff", fontcolor="#c79bff", tooltip="FK_articlesupplier_article", weight=3]; + articlesupplier:entity_id:e -> entity:in0:n [color="#ff9f5a", fontcolor="#ff9f5a", tooltip="FK_articlesupplier_entity", constraint=false, weight=1]; + articlesupplier:tax_id:e -> tax:in0:n [color="#5cd6d6", fontcolor="#5cd6d6", tooltip="FK_articlesupplier_tax", constraint=false, weight=1]; + manifest:company_id:w -> company:in10:n [color="#ff7fc2", fontcolor="#ff7fc2", tooltip="FK_manifest_company", weight=3]; + manifest:entity_id:e -> entity:in1:n [color="#8f95ff", fontcolor="#8f95ff", tooltip="FK_manifest_entity", constraint=false, weight=1]; manifestarticle:manifest_id:sw -> manifest:in2:n [color="#58d18a", fontcolor="#58d18a", tooltip="FK_manifestarticle_manifest", weight=3]; - warehouse:company_id:w -> company:in19:n [color="#ff8f66", fontcolor="#ff8f66", tooltip="FK_warehouse_company", weight=3]; - ledger:manifestarticle_id:nw -> manifestarticle:in0:n [color="#4fc4e8", fontcolor="#4fc4e8", tooltip="FK_ledger_manifestarticle", weight=3]; - ledger:warehouse_id:w -> warehouse:in0:n [color="#a98cff", fontcolor="#a98cff", tooltip="FK_ledger_warehouse", constraint=false, weight=1]; - numbers:company_id:e -> company:in1:n [color="#ff6f6f", fontcolor="#ff6f6f", tooltip="FK_numbers_company", weight=3]; - companyuser:google_auth_id:e -> google_auth:in2:n [color="#4ecb8f", fontcolor="#4ecb8f", tooltip="FK_companyuser_google_auth", constraint=false, weight=1]; - companyuser:company_id:e -> company:in4:n [color="#5aa7e6", fontcolor="#5aa7e6", tooltip="FK_companyuser_company", weight=3]; - modelconversation:companyuser_id:e -> companyuser:in0:n [color="#ff7aa8", fontcolor="#ff7aa8", tooltip="FK_modelconversation_companyuser", weight=3]; - modelvfs:company_id:e -> company:in0:n [color="#e0b25a", fontcolor="#e0b25a", tooltip="FK_modelvfs_company", weight=3]; + warehouse:company_id:e -> company:in11:n [color="#ff8f66", fontcolor="#ff8f66", tooltip="FK_warehouse_company", weight=3]; + ledger:manifestarticle_id:sw -> manifestarticle:in0:n [color="#4fc4e8", fontcolor="#4fc4e8", tooltip="FK_ledger_manifestarticle", weight=3]; + ledger:warehouse_id:e -> warehouse:in0:n [color="#a98cff", fontcolor="#a98cff", tooltip="FK_ledger_warehouse", constraint=false, weight=1]; + numbers:company_id:sw -> company:in18:n [color="#ff6f6f", fontcolor="#ff6f6f", tooltip="FK_numbers_company", weight=3]; + companyuser:google_auth_id:e -> google_auth:in0:n [color="#4ecb8f", fontcolor="#4ecb8f", tooltip="FK_companyuser_google_auth", constraint=false, weight=1]; + companyuser:company_id:w -> company:in20:n [color="#5aa7e6", fontcolor="#5aa7e6", tooltip="FK_companyuser_company", weight=3]; + modelconversation:companyuser_id:e -> companyuser:in1:n [color="#ff7aa8", fontcolor="#ff7aa8", tooltip="FK_modelconversation_companyuser", weight=3]; + modelvfs:company_id:sw -> company:in13:n [color="#e0b25a", fontcolor="#e0b25a", tooltip="FK_modelvfs_company", weight=3]; modelmessage:conversation_id:sw -> modelconversation:in0:n [color="#56c8c8", fontcolor="#56c8c8", tooltip="FK_modelmessage_conversation", weight=3]; - companysetting:company_id:se -> company:in5:n [color="#ff5f9e", fontcolor="#ff5f9e", tooltip="FK_companysetting_company", weight=3]; - posterminal:company_id:e -> company:in13:n [color="#ffb25a", fontcolor="#ffb25a", tooltip="FK_posterminal_company", weight=3]; - posterminal:root_category_id:w -> category:in8:n [color="#56d68a", fontcolor="#56d68a", tooltip="FK_posterminal_root_category", constraint=false, weight=1]; + companysetting:company_id:e -> company:in21:n [color="#ff5f9e", fontcolor="#ff5f9e", tooltip="FK_companysetting_company", weight=3]; + posterminal:company_id:e -> company:in6:n [color="#ffb25a", fontcolor="#ffb25a", tooltip="FK_posterminal_company", weight=3]; + posterminal:root_category_id:w -> category:in7:n [color="#56d68a", fontcolor="#56d68a", tooltip="FK_posterminal_root_category", constraint=false, weight=1]; posterminalcategory:posterminal_id:se -> posterminal:in0:n [color="#66b3ff", fontcolor="#66b3ff", tooltip="FK_posterminalcategory_posterminal", weight=3]; - posterminalcategory:category_id:w -> category:in7:n [color="#c79bff", fontcolor="#c79bff", tooltip="FK_posterminalcategory_category", constraint=false, weight=1]; - printer:company_id:w -> company:in14:n [color="#ff6b6b", fontcolor="#ff6b6b", tooltip="FK_printer_company", weight=3]; - labeltemplate:company_id:w -> company:in16:n [color="#6bdf9a", fontcolor="#6bdf9a", tooltip="FK_labeltemplate_company", weight=3]; - manifestattachment:manifest_id:se -> manifest:in1:n [color="#5aa7ff", fontcolor="#5aa7ff", tooltip="FK_manifestattachment_manifest", weight=3]; + posterminalcategory:category_id:e -> category:in6:n [color="#c79bff", fontcolor="#c79bff", tooltip="FK_posterminalcategory_category", constraint=false, weight=1]; + printer:company_id:w -> company:in7:n [color="#ff6b6b", fontcolor="#ff6b6b", tooltip="FK_printer_company", weight=3]; + labeltemplate:company_id:e -> company:in9:n [color="#6bdf9a", fontcolor="#6bdf9a", tooltip="FK_labeltemplate_company", weight=3]; + manifestattachment:manifest_id:sw -> manifest:in1:n [color="#5aa7ff", fontcolor="#5aa7ff", tooltip="FK_manifestattachment_manifest", weight=3]; manifestattachment:file_id:w -> file:in0:n [color="#f5c15c", fontcolor="#f5c15c", tooltip="FK_manifestattachment_file", constraint=false, weight=1]; - propertyname:company_id:nw -> company:in7:n [color="#c79bff", fontcolor="#c79bff", tooltip="FK_propertyname_company", weight=3]; - articleproperty:article_id:w -> article:in0:n [color="#ff9f5a", fontcolor="#ff9f5a", tooltip="FK_articleproperty_article", weight=3]; - articleproperty:property_id:w -> propertyname:in1:n [color="#5cd6d6", fontcolor="#5cd6d6", tooltip="FK_articleproperty_property", constraint=false, weight=1]; - attributename:company_id:w -> company:in8:n [color="#ff7fc2", fontcolor="#ff7fc2", tooltip="FK_attributename_company", weight=3]; - attributevalue:attribute_id:sw -> attributename:in0:n [color="#8f95ff", fontcolor="#8f95ff", tooltip="FK_attributevalue_attribute", weight=3]; - articleattributevalue:article_id:w -> article:in1:n [color="#58d18a", fontcolor="#58d18a", tooltip="FK_articleattributevalue_article", weight=3]; - articleattributevalue:attributevalue_id:w -> attributevalue:in0:n [color="#ff8f66", fontcolor="#ff8f66", tooltip="FK_articleattributevalue_attributevalue", constraint=false, weight=1]; - categoryproperty:category_id:e -> category:in3:n [color="#4fc4e8", fontcolor="#4fc4e8", tooltip="FK_categoryproperty_category", weight=3]; - categoryproperty:property_id:w -> propertyname:in0:n [color="#a98cff", fontcolor="#a98cff", tooltip="FK_categoryproperty_property", constraint=false, weight=1]; - categoryattributevalue:category_id:e -> category:in1:n [color="#ff6f6f", fontcolor="#ff6f6f", tooltip="FK_categoryattributevalue_category", weight=3]; - categoryattributevalue:attributevalue_id:w -> attributevalue:in1:n [color="#4ecb8f", fontcolor="#4ecb8f", tooltip="FK_categoryattributevalue_attributevalue", constraint=false, weight=1]; - account:company_id:w -> company:in15:n [color="#5aa7e6", fontcolor="#5aa7e6", tooltip="FK_account_company", weight=3]; + propertyname:company_id:e -> company:in5:n [color="#c79bff", fontcolor="#c79bff", tooltip="FK_propertyname_company", weight=3]; + articleproperty:article_id:e -> article:in9:n [color="#ff9f5a", fontcolor="#ff9f5a", tooltip="FK_articleproperty_article", weight=3]; + articleproperty:property_id:w -> propertyname:in0:n [color="#5cd6d6", fontcolor="#5cd6d6", tooltip="FK_articleproperty_property", constraint=false, weight=1]; + attributename:company_id:e -> company:in4:n [color="#ff7fc2", fontcolor="#ff7fc2", tooltip="FK_attributename_company", weight=3]; + attributevalue:attribute_id:se -> attributename:in2:n [color="#8f95ff", fontcolor="#8f95ff", tooltip="FK_attributevalue_attribute", weight=3]; + articleattributevalue:article_id:e -> article:in10:n [color="#58d18a", fontcolor="#58d18a", tooltip="FK_articleattributevalue_article", weight=3]; + articleattributevalue:attributevalue_id:w -> attributevalue:in2:n [color="#ff8f66", fontcolor="#ff8f66", tooltip="FK_articleattributevalue_attributevalue", constraint=false, weight=1]; + categoryproperty:category_id:w -> category:in4:n [color="#4fc4e8", fontcolor="#4fc4e8", tooltip="FK_categoryproperty_category", weight=3]; + categoryproperty:property_id:e -> propertyname:in1:n [color="#a98cff", fontcolor="#a98cff", tooltip="FK_categoryproperty_property", constraint=false, weight=1]; + categoryattributevalue:category_id:w -> category:in5:n [color="#ff6f6f", fontcolor="#ff6f6f", tooltip="FK_categoryattributevalue_category", weight=3]; + categoryattributevalue:attributevalue_id:e -> attributevalue:in1:n [color="#4ecb8f", fontcolor="#4ecb8f", tooltip="FK_categoryattributevalue_attributevalue", constraint=false, weight=1]; + account:company_id:e -> company:in8:n [color="#5aa7e6", fontcolor="#5aa7e6", tooltip="FK_account_company", weight=3]; payment:account_id:w -> account:in0:n [color="#ff7aa8", fontcolor="#ff7aa8", tooltip="FK_payment_account", constraint=false, weight=1]; payment:manifest_id:se -> manifest:in0:n [color="#e0b25a", fontcolor="#e0b25a", tooltip="FK_payment_manifest", weight=3]; - shipping:manifest_id:sw -> manifest:in3:n [color="#56c8c8", fontcolor="#56c8c8", tooltip="FK_shipping_manifest", weight=3]; - package:shipping_id:se -> shipping:in0:n [color="#ff5f9e", fontcolor="#ff5f9e", tooltip="FK_package_shipping", constraint=false, weight=1]; - package:entityaddress_id:w -> entityaddress:in0:n [color="#ffb25a", fontcolor="#ffb25a", tooltip="FK_package_entityaddress", weight=3]; - ordersummary:company_id:e -> company:in21:n [color="#56d68a", fontcolor="#56d68a", tooltip="FK_ordersummary_company", weight=3]; - ordersummary:manifest_id:w -> manifest:in6:n [color="#66b3ff", fontcolor="#66b3ff", tooltip="FK_ordersummary_manifest", constraint=false, weight=1]; - ordersummary:entity_id:w -> entity:in8:n [color="#c79bff", fontcolor="#c79bff", tooltip="FK_ordersummary_entity", constraint=false, weight=1]; - quotesummary:company_id:e -> company:in20:n [color="#ff6b6b", fontcolor="#ff6b6b", tooltip="FK_quotesummary_company", weight=3]; - quotesummary:manifest_id:w -> manifest:in7:n [color="#6bdf9a", fontcolor="#6bdf9a", tooltip="FK_quotesummary_manifest", constraint=false, weight=1]; - quotesummary:entity_id:w -> entity:in6:n [color="#5aa7ff", fontcolor="#5aa7ff", tooltip="FK_quotesummary_entity", constraint=false, weight=1]; - shipmentsummary:company_id:e -> company:in18:n [color="#f5c15c", fontcolor="#f5c15c", tooltip="FK_shipmentsummary_company", weight=3]; - shipmentsummary:manifest_id:sw -> manifest:in4:n [color="#c79bff", fontcolor="#c79bff", tooltip="FK_shipmentsummary_manifest", constraint=false, weight=1]; - shipmentsummary:entity_id:w -> entity:in4:n [color="#ff9f5a", fontcolor="#ff9f5a", tooltip="FK_shipmentsummary_entity", constraint=false, weight=1]; - deliverysummary:company_id:e -> company:in22:n [color="#5cd6d6", fontcolor="#5cd6d6", tooltip="FK_deliverysummary_company", weight=3]; - deliverysummary:manifest_id:sw -> manifest:in5:n [color="#ff7fc2", fontcolor="#ff7fc2", tooltip="FK_deliverysummary_manifest", constraint=false, weight=1]; - deliverysummary:supplier_id:w -> entity:in7:n [color="#8f95ff", fontcolor="#8f95ff", tooltip="FK_deliverysummary_supplier", constraint=false, weight=1]; - mcp_auth_code:google_auth_id:e -> google_auth:in1:n [color="#58d18a", fontcolor="#58d18a", tooltip="FK_mcp_auth_code_google_auth", weight=3]; - mcp_token:google_auth_id:e -> google_auth:in0:n [color="#ff8f66", fontcolor="#ff8f66", tooltip="FK_mcp_token_google_auth", weight=3]; + shipping:manifest_id:w -> manifest:in4:n [color="#56c8c8", fontcolor="#56c8c8", tooltip="FK_shipping_manifest", weight=3]; + package:shipping_id:e -> shipping:in0:n [color="#ff5f9e", fontcolor="#ff5f9e", tooltip="FK_package_shipping", constraint=false, weight=1]; + package:entityaddress_id:e -> entityaddress:in0:n [color="#ffb25a", fontcolor="#ffb25a", tooltip="FK_package_entityaddress", weight=3]; + ordersummary:company_id:se -> company:in15:n [color="#56d68a", fontcolor="#56d68a", tooltip="FK_ordersummary_company", weight=3]; + ordersummary:manifest_id:w -> manifest:in7:n [color="#66b3ff", fontcolor="#66b3ff", tooltip="FK_ordersummary_manifest", constraint=false, weight=1]; + ordersummary:entity_id:e -> entity:in5:n [color="#c79bff", fontcolor="#c79bff", tooltip="FK_ordersummary_entity", constraint=false, weight=1]; + quotesummary:company_id:e -> company:in12:n [color="#ff6b6b", fontcolor="#ff6b6b", tooltip="FK_quotesummary_company", weight=3]; + quotesummary:manifest_id:nw -> manifest:in3:n [color="#6bdf9a", fontcolor="#6bdf9a", tooltip="FK_quotesummary_manifest", constraint=false, weight=1]; + quotesummary:entity_id:e -> entity:in2:n [color="#5aa7ff", fontcolor="#5aa7ff", tooltip="FK_quotesummary_entity", constraint=false, weight=1]; + shipmentsummary:company_id:se -> company:in14:n [color="#f5c15c", fontcolor="#f5c15c", tooltip="FK_shipmentsummary_company", weight=3]; + shipmentsummary:manifest_id:sw -> manifest:in5:n [color="#c79bff", fontcolor="#c79bff", tooltip="FK_shipmentsummary_manifest", constraint=false, weight=1]; + shipmentsummary:entity_id:e -> entity:in3:n [color="#ff9f5a", fontcolor="#ff9f5a", tooltip="FK_shipmentsummary_entity", constraint=false, weight=1]; + deliverysummary:company_id:se -> company:in16:n [color="#5cd6d6", fontcolor="#5cd6d6", tooltip="FK_deliverysummary_company", weight=3]; + deliverysummary:manifest_id:sw -> manifest:in6:n [color="#ff7fc2", fontcolor="#ff7fc2", tooltip="FK_deliverysummary_manifest", constraint=false, weight=1]; + deliverysummary:supplier_id:e -> entity:in4:n [color="#8f95ff", fontcolor="#8f95ff", tooltip="FK_deliverysummary_supplier", constraint=false, weight=1]; + mcp_auth_code:google_auth_id:sw -> google_auth:in2:n [color="#58d18a", fontcolor="#58d18a", tooltip="FK_mcp_auth_code_google_auth", weight=3]; + mcp_token:google_auth_id:sw -> google_auth:in1:n [color="#ff8f66", fontcolor="#ff8f66", tooltip="FK_mcp_token_google_auth", weight=3]; + subagentschedule:company_id:w -> company:in23:n [color="#4fc4e8", fontcolor="#4fc4e8", tooltip="FK_subagentschedule_company", weight=3]; } \ No newline at end of file diff --git a/schema-graph.svg b/schema-graph.svg index 18ca2f5..16bb2a0 100644 --- a/schema-graph.svg +++ b/schema-graph.svg @@ -4,877 +4,951 @@ - - + + schema - + cluster_identity - -Identity & Company + +Identity & Company cluster_i18n - -Localization + +Localization cluster_catalog - -Catalog + +Catalog cluster_media - -Media + +Media cluster_manifests - -Documents & Shipping + +Documents & Shipping cluster_commerce - -Pricing & Payments + +Pricing & Payments cluster_units - -Units + +Units cluster_pos - -POS + +POS cluster_ai - -AI & Models + +AI & Models cluster_attributes - -Properties & Attributes - - - -companyhistory - - -companyhistory - - -id -INT -PK - - -companyuser_id -? -INT -FK - - -company_id -INT -FK - - -date -DATETIME2 - - -text -NVARCHAR(MAX) - - - -companyuser - - - - - - -companyuser - - -id -INT -PK - - -google_auth_id -INT -FK - - -company_id -INT -FK - - - -companyhistory:e->companyuser:n - - - - - - - - -company - - - - - - - - - - - - - - - - - - - - - - - - - -company - - -id -INT -PK - - -poscustomergroup_id -INT -FK - - -default_language_id -? -INT -FK - - -root_category_id -? -INT -FK - - -taxrate -? -INT -FK - - -reducedtaxrate -? -INT -FK - - -taxfreerate -? -INT -FK - - -name -NVARCHAR(255) - - - -companyhistory:e->company:n - - - - - - - - -meta - - -meta - - -key -NVARCHAR(255) - - -value -NVARCHAR(MAX) - - - -numbers - - -numbers - - -id -INT -PK - - -company_id -INT -FK - - -type -NVARCHAR(100) - - -prefix -NVARCHAR(50) - - -padding -INT - - -next -INT - - - -numbers:e->company:n - - - - - - - - -google_auth - - - - - -google_auth - - -id -INT -PK - - -selected_company -? -INT -FK - - -email -NVARCHAR(320) - - -picture? -NVARCHAR(2048) - - -picturebinary? -VARBINARY(MAX) - - -sub? -NVARCHAR(255) - - -created_at -DATETIME2 - - - -companyuser:e->google_auth:n - - - - - - - - -companyuser:e->company:n - - - - - - - - -entityaddress - - - -entityaddress - - -id -INT -PK - - -entity_id -INT -FK - - -first_name? -NVARCHAR(255) - - -name? -NVARCHAR(255) - - -street? -NVARCHAR(255) - - -streetnumber? -NVARCHAR(50) - - -zip? -NVARCHAR(50) - - -city? -NVARCHAR(255) - - -county? -NVARCHAR(255) - - -addresstype -NVARCHAR(50) - - -sort -INT - - - -entity - - - - - - - - - - - -entity - - -id -INT -PK - - -customergroup_id -INT -FK - - -first_name? -NVARCHAR(255) - - -name -NVARCHAR(255) - - -number? -NVARCHAR(100) - - -created_at -DATETIME2 - - -updated_at -DATETIME2 - - - -entityaddress:se->entity:n - - - - - - - - -companysetting - - -companysetting - - -id -INT -PK - - -company_id -INT -FK - - -key -NVARCHAR(255) - - -value -NVARCHAR(MAX) - - -frontend -BIT - - -writeonly -BIT - - - -companysetting:se->company:n - - - - - + +Properties & Attributes - + customergroup - - - - - -customergroup - - -id -INT -PK - - -company_id -? -INT -FK - - -name -NVARCHAR(255) - - -sort -INT - - -updated_at -DATETIME2 + + + + + +customergroup + + +id +INT +PK + + +company_id +? +INT +FK + + +name +NVARCHAR(255) + + +sort +INT + + +updated_at +DATETIME2 - - -entity:se->customergroup:n - - - - + + +company + + + + + + + + + + + + + + + + + + + + + + + + + + +company + + +id +INT +PK + + +root_category_id +? +INT +FK + + +default_language_id +? +INT +FK + + +taxrate +? +INT +FK + + +reducedtaxrate +? +INT +FK + + +taxfreerate +? +INT +FK + + +poscustomergroup_id +INT +FK + + +name +NVARCHAR(255) - - - -entitycontact - - -entitycontact - - -id -INT -PK - - -entity_id -INT -FK - - -contacttype -NVARCHAR(50) - - -contact -NVARCHAR(255) - - -sort -INT - - - -entitycontact:se->entity:n - - - - - - - - -google_auth:se->company:n - - - + + +customergroup:ne->company:n + + + -company:ne->customergroup:n +company:se->customergroup:n - - + + language - - - - - - -language - - -id -INT -PK - - -iso639 -NVARCHAR(10) + + + + + + +language + + +id +INT +PK + + +iso639 +NVARCHAR(10) company:w->language:n - - + + - + category - - - - - - - - - - - -category - - -id -INT -PK - - -parent_id -? -INT -FK - - -sort -INT - - -updated_at -DATETIME2 + + + + + + + + + + + +category + + +id +INT +PK + + +parent_id +? +INT +FK + + +sort +INT + + +updated_at +DATETIME2 -company:e->category:n +company:w->category:n - - + + tax - - - - - - - -tax - - -id -INT -PK - - -rate -DECIMAL(18,4) + + + + + + + +tax + + +id +INT +PK + + +rate +DECIMAL(18,4) -company:e->tax:n +company:w->tax:n - - + + -company:e->tax:n +company:w->tax:n - - + + -company:e->tax:n +company:w->tax:n - - + + + + + + + +meta + + +meta + + +key +NVARCHAR(255) + + +value +NVARCHAR(MAX) + + + +companyhistory + + +companyhistory + + +id +INT +PK + + +company_id +INT +FK + + +companyuser_id +? +INT +FK + + +date +DATETIME2 + + +text +NVARCHAR(MAX) + + + +companyhistory:sw->company:n + + + + + + + + +companyuser + + + + + + +companyuser + + +id +INT +PK + + +company_id +INT +FK + + +google_auth_id +INT +FK + + + +companyhistory:e->companyuser:n + + + + + + + + +entityaddress + + + +entityaddress + + +id +INT +PK + + +entity_id +INT +FK + + +first_name? +NVARCHAR(255) + + +name? +NVARCHAR(255) + + +street? +NVARCHAR(255) + + +streetnumber? +NVARCHAR(50) + + +zip? +NVARCHAR(50) + + +city? +NVARCHAR(255) + + +county? +NVARCHAR(255) + + +addresstype +NVARCHAR(50) + + +sort +INT + + + +entity + + + + + + + + + + + +entity + + +id +INT +PK + + +customergroup_id +INT +FK + + +first_name? +NVARCHAR(255) + + +name +NVARCHAR(255) + + +number? +NVARCHAR(100) + + +created_at +DATETIME2 + + +updated_at +DATETIME2 + + + +entityaddress:ne->entity:n + + + + + + + + +numbers + + +numbers + + +id +INT +PK + + +company_id +INT +FK + + +type +NVARCHAR(100) + + +prefix +NVARCHAR(50) + + +padding +INT + + +next +INT + + + +numbers:sw->company:n + + + + + + + + +entity:sw->customergroup:n + + + + + + + + +entitycontact + + +entitycontact + + +id +INT +PK + + +entity_id +INT +FK + + +contacttype +NVARCHAR(50) + + +contact +NVARCHAR(255) + + +sort +INT + + + +entitycontact:sw->entity:n + + + + + + + + +companyuser:w->company:n + + + + + + + + +google_auth + + + + + +google_auth + + +id +INT +PK + + +selected_company +? +INT +FK + + +email +NVARCHAR(320) + + +picture? +NVARCHAR(2048) + + +picturebinary? +VARBINARY(MAX) + + +sub? +NVARCHAR(255) + + +created_at +DATETIME2 + + + +companyuser:e->google_auth:n + + + - + entityhistory - - -entityhistory - - -id -INT -PK - - -companyuser_id -? -INT -FK - - -entity_id -INT -FK - - -date -DATETIME2 - - -text -NVARCHAR(MAX) + + +entityhistory + + +id +INT +PK + + +entity_id +INT +FK + + +companyuser_id +? +INT +FK + + +date +DATETIME2 + + +text +NVARCHAR(MAX) + + + +entityhistory:sw->entity:n + + + + + entityhistory:se->companyuser:n - - + + - - -entityhistory:ne->entity:n - - - + + +companysetting + + +companysetting + + +id +INT +PK + + +company_id +INT +FK + + +key +NVARCHAR(255) + + +value +NVARCHAR(MAX) + + +frontend +BIT + + +writeonly +BIT + + + +companysetting:e->company:n + + + - - -customergroup:sw->company:n - - - + + +google_auth:w->company:n + + + - + -unittext - - -unittext - - -id -INT -PK - - -language_id -INT -FK - - -unit_id -INT -FK - - -symbol -NVARCHAR(50) - - -name -NVARCHAR(255) +articletext + + +articletext + + +id +INT +PK + + +article_id +INT +FK + + +language_id +INT +FK + + +name +NVARCHAR(255) + + +slug +NVARCHAR(255) + + +seo? +NVARCHAR(MAX) + + +desc? +NVARCHAR(MAX) - - -unittext:w->language:n - - - + + +articletext:w->language:n + + + - - -unit - - - - -unit - - -id -INT -PK - - -company_id -INT -FK - - -si -NVARCHAR(50) - - -basesi -NVARCHAR(50) - - -basesifactor -FLOAT + + +article + + + + + + + + + + + + + + +article + + +id +INT +PK + + +brand_id +? +INT +FK + + +articlelist_id +? +INT +FK + + +optionslist_id +? +INT +FK + + +parentarticle_id +? +INT +FK + + +unit_id +INT +FK + + +parentattributename_id +? +INT +FK + + +company_id +INT +FK + + +sku? +NVARCHAR(100) + + +unitamount +FLOAT + + +weight +FLOAT + + +track_stock +BIT + + +is_parent +BIT + + +parentsort +INT + + +created_at +DATETIME2 + + +updated_at +DATETIME2 - - -unittext:se->unit:n - - - + + +articletext:e->article:n + + + categorytext - - -categorytext - - -id -INT -PK - - -language_id -INT -FK - - -category_id -INT -FK - - -name -NVARCHAR(255) - - -slug -NVARCHAR(255) - - -seo? -NVARCHAR(MAX) - - -desc? -NVARCHAR(MAX) + + +categorytext + + +id +INT +PK + + +category_id +INT +FK + + +language_id +INT +FK + + +name +NVARCHAR(255) + + +slug +NVARCHAR(255) + + +seo? +NVARCHAR(MAX) + + +desc? +NVARCHAR(MAX) -categorytext:e->language:n +categorytext:w->language:n - - + + @@ -882,253 +956,345 @@ categorytext:e->category:n - - + + - + -articletext - - -articletext - - -id -INT -PK - - -language_id -INT -FK - - -article_id -INT -FK - - -name -NVARCHAR(255) - - -slug -NVARCHAR(255) - - -seo? -NVARCHAR(MAX) - - -desc? -NVARCHAR(MAX) +unittext + + +unittext + + +id +INT +PK + + +language_id +INT +FK + + +unit_id +INT +FK + + +symbol +NVARCHAR(50) + + +name +NVARCHAR(255) - - -articletext:w->language:n - - - + + +unittext:w->language:n + + + - - -article - - - - - - - - - - - - - - -article - - -id -INT -PK - - -company_id -INT -FK - - -parentattributename_id -? -INT -FK - - -unit_id -INT -FK - - -parentarticle_id -? -INT -FK - - -articlelist_id -? -INT -FK - - -optionslist_id -? -INT -FK - - -brand_id -? -INT -FK - - -sku? -NVARCHAR(100) - - -unitamount -FLOAT - - -weight -FLOAT - - -track_stock -BIT - - -is_parent -BIT - - -parentsort -INT - - -created_at -DATETIME2 - - -updated_at -DATETIME2 + + +unit + + + + +unit + + +id +INT +PK + + +company_id +INT +FK + + +si +NVARCHAR(50) + + +basesi +NVARCHAR(50) + + +basesifactor +FLOAT - - -articletext:e->article:n - - - + + +unittext:se->unit:n + + + - + -categoryarticle - - -categoryarticle - - -id -INT -PK - - -category_id -INT -FK - - -article_id -INT -FK +brand + + + + +brand + + +id +INT +PK + + +company_id +INT +FK + + +name +NVARCHAR(255) + + +gsprpinfo? +NVARCHAR(MAX) - - -categoryarticle:se->category:n - - - + + +brand:e->company:n + + + - - -categoryarticle:se->article:n - - - + + +articletombstone + + +articletombstone + + +id +INT +PK + + +company_id +INT +FK + + +article_id? +INT + + +sku? +NVARCHAR(100) + + +name? +NVARCHAR(255) + + +taxrate? +DECIMAL(18,4) + + +net? +FLOAT + + +deleted_at +DATETIME2 + + + +articletombstone:e->company:n + + + - - -category:e->category:e - - - + + +articlelist + + + + +articlelist + + +id +INT +PK + + + +articlelistarticle + + +articlelistarticle + + +id +INT +PK + + +articlelist_id +INT +FK + + +article_id +INT +FK + + +count +INT + + +sort +INT + + + +articlelistarticle:nw->articlelist:n + + + + + + + + +articlelistarticle:w->article:n + + + + + + + + +optionslist + + + + +optionslist + + +id +INT +PK + + + +optionslistarticle + + +optionslistarticle + + +id +INT +PK + + +optionslist_id +INT +FK + + +article_id +INT +FK + + +count +INT + + +sort +INT + + +mandated +BIT + + + +optionslistarticle:sw->optionslist:n + + + + + + + + +optionslistarticle:e->article:n + + + - + articlehistory - - -articlehistory - - -id -INT -PK - - -companyuser_id -? -INT -FK - - -article_id -INT -FK - - -date -DATETIME2 - - -text -NVARCHAR(MAX) - - -meta? -NVARCHAR(MAX) + + +articlehistory + + +id +INT +PK + + +article_id +INT +FK + + +companyuser_id +? +INT +FK + + +date +DATETIME2 + + +text +NVARCHAR(MAX) + + +meta? +NVARCHAR(MAX) -articlehistory:w->companyuser:n +articlehistory:e->companyuser:n - - + + @@ -1136,17 +1302,74 @@ articlehistory:se->article:n - - + + + + + + + +articleean + + +articleean + + +id +INT +PK + + +article_id +INT +FK + + +ean +NVARCHAR(50) + + + +articleean:ne->article:n + + + -article:w->company:n +article:e->company:n - - + + + + + + + +article:w->brand:n + + + + + + + + +article:w->articlelist:n + + + + + + + + +article:w->optionslist:n + + + @@ -1154,236 +1377,124 @@ article:e->article:e - - - - - - - -articlelist - - - - -articlelist - - -id -INT -PK - - - -article:e->articlelist:n - - - - - - - - -optionslist - - - - -optionslist - - -id -INT -PK - - - -article:e->optionslist:n - - - - - - - - -brand - - - - -brand - - -id -INT -PK - - -company_id -INT -FK - - -name -NVARCHAR(255) - - -gsprpinfo? -NVARCHAR(MAX) - - - -article:e->brand:n - - - + + -article:w->unit:n +article:e->unit:n - - + + - + attributename - - - - - -attributename - - -id -INT -PK - - -company_id -INT -FK - - -name -NVARCHAR(255) - - -sort -INT - - -exclusive -BIT + + + + + +attributename + + +id +INT +PK + + +company_id +INT +FK + + +name +NVARCHAR(255) + + +sort +INT + + +exclusive +BIT -article:sw->attributename:n +article:se->attributename:n - - + + -article:sw->attributename:n +article:se->attributename:n - - - - - - - -articleean - - -articleean - - -id -INT -PK - - -article_id -INT -FK - - -ean -NVARCHAR(50) - - - -articleean:sw->article:n - - - + + - + articlesupplier - - -articlesupplier - - -id -INT -PK - - -entity_id -INT -FK - - -article_id -INT -FK - - -tax_id -? -INT -FK - - -net? -FLOAT - - -sku? -NVARCHAR(100) - - -stock? -FLOAT - - -pu -FLOAT - - -sort -INT + + +articlesupplier + + +id +INT +PK + + +article_id +INT +FK + + +tax_id +? +INT +FK + + +entity_id +INT +FK + + +net? +FLOAT + + +sku? +NVARCHAR(100) + + +stock? +FLOAT + + +pu +FLOAT + + +sort +INT -articlesupplier:w->entity:n +articlesupplier:e->entity:n - - + + @@ -1391,8 +1502,8 @@ articlesupplier:sw->article:n - - + + @@ -1400,430 +1511,160 @@ articlesupplier:e->tax:n - - + + - - -articlelistarticle - - -articlelistarticle - - -id -INT -PK - - -article_id -INT -FK - - -articlelist_id -INT -FK - - -count -INT - - -sort -INT - - - -articlelistarticle:e->article:n - - - + + +category:e->category:e + + + - - -articlelistarticle:se->articlelist:n - - - - - - - - -optionslistarticle - - -optionslistarticle - - -id -INT -PK - - -article_id -INT -FK - - -optionslist_id -INT -FK - - -count -INT - - -sort -INT - - -mandated -BIT - - - -optionslistarticle:e->article:n - - - - - - - - -optionslistarticle:sw->optionslist:n - - - - - - - - -brand:w->company:n - - - - - - - + -articletombstone - - -articletombstone - - -id -INT -PK - - -company_id -INT -FK - - -article_id? -INT - - -sku? -NVARCHAR(100) - - -name? -NVARCHAR(255) - - -taxrate? -DECIMAL(18,4) - - -net? -FLOAT - - -deleted_at -DATETIME2 +categoryarticle + + +categoryarticle + + +id +INT +PK + + +article_id +INT +FK + + +category_id +INT +FK - - -articletombstone:e->company:n - - - + + +categoryarticle:sw->article:n + + + + + + + + +categoryarticle:nw->category:n + + + pic - - - - - - -pic - - -id -INT -PK - - -w -INT - - -h -INT - - -size -BIGINT - - -hash -NVARCHAR(64) - - -thumbw -INT - - -thumbh -INT - - -thumbhash -NVARCHAR(64) - - -smallthumbw -INT - - -smallthumbh -INT - - -source -NVARCHAR(MAX) - - -fullbinary -VARBINARY(MAX) - - -thumbbinary -VARBINARY(MAX) - - -smallthumbbinary -VARBINARY(MAX) - - - -attributevaluepic - - -attributevaluepic - - -id -INT -PK - - -attributevalue_id -INT -FK - - -pic_id -INT -FK - - -sort -INT - - - -attributevaluepic:w->pic:n - - - - - - - - -attributevalue - - - - - -attributevalue - - -id -INT -PK - - -attribute_id -INT -FK - - -value -NVARCHAR(255) - - -sort -INT - - - -attributevaluepic:e->attributevalue:n - - - - - - - - -categorypic - - -categorypic - - -id -INT -PK - - -pic_id -INT -FK - - -category_id -INT -FK - - -sort -INT - - - -categorypic:se->category:n - - - - - - - - -categorypic:w->pic:n - - - - - - - - -articlepic - - -articlepic - - -id -INT -PK - - -pic_id -INT -FK - - -article_id -INT -FK - - -sort -INT - - - -articlepic:se->article:n - - - - - - - - -articlepic:w->pic:n - - - - - + + + + + + +pic + + +id +INT +PK + + +w +INT + + +h +INT + + +size +BIGINT + + +hash +NVARCHAR(64) + + +thumbw +INT + + +thumbh +INT + + +thumbhash +NVARCHAR(64) + + +smallthumbw +INT + + +smallthumbh +INT + + +source +NVARCHAR(MAX) + + +fullbinary +VARBINARY(MAX) + + +thumbbinary +VARBINARY(MAX) + + +smallthumbbinary +VARBINARY(MAX) - + brandpic - - -brandpic - - -id -INT -PK - - -pic_id -INT -FK - - -brand_id -INT -FK - - -sort -INT + + +brandpic + + +id +INT +PK + + +brand_id +INT +FK + + +pic_id +INT +FK + + +sort +INT -brandpic:e->brand:n +brandpic:w->brand:n - - + + @@ -1831,263 +1672,461 @@ brandpic:w->pic:n - - + + + + + + + +articlepic + + +articlepic + + +id +INT +PK + + +article_id +INT +FK + + +pic_id +INT +FK + + +sort +INT + + + +articlepic:se->article:n + + + + + + + + +articlepic:w->pic:n + + + + + + + + +categorypic + + +categorypic + + +id +INT +PK + + +pic_id +INT +FK + + +category_id +INT +FK + + +sort +INT + + + +categorypic:sw->category:n + + + + + + + + +categorypic:w->pic:n + + + + + + + + +attributevaluepic + + +attributevaluepic + + +id +INT +PK + + +pic_id +INT +FK + + +attributevalue_id +INT +FK + + +sort +INT + + + +attributevaluepic:w->pic:n + + + + + + + + +attributevalue + + + + + +attributevalue + + +id +INT +PK + + +attribute_id +INT +FK + + +value +NVARCHAR(255) + + +sort +INT + + + +attributevaluepic:e->attributevalue:n + + + file - - - -file - - -id -INT -PK - - -hash -NVARCHAR(64) - - -mimetype -NVARCHAR(255) - - -name -NVARCHAR(255) - - -size -BIGINT - - -created -DATETIME2 - - -modified -DATETIME2 - - -content -VARBINARY(MAX) - - -thumbavif? -VARBINARY(MAX) - - -thumbx? -INT - - -thumby? -INT - - -meta? -NVARCHAR(MAX) + + + +file + + +id +INT +PK + + +hash +NVARCHAR(64) + + +mimetype +NVARCHAR(255) + + +name +NVARCHAR(255) + + +size +BIGINT + + +created +DATETIME2 + + +modified +DATETIME2 + + +content +VARBINARY(MAX) + + +thumbavif? +VARBINARY(MAX) + + +thumbx? +INT + + +thumby? +INT + + +meta? +NVARCHAR(MAX) manifestattachment - - -manifestattachment - - -id -INT -PK - - -file_id -INT -FK - - -manifest_id -INT -FK - - -sort -INT + + +manifestattachment + + +id +INT +PK + + +file_id +INT +FK + + +manifest_id +INT +FK + + +sort +INT manifestattachment:w->file:n - - + + manifest - - - - - - - - - - -manifest - - -id -INT -PK - - -entity_id -? -INT -FK - - -company_id -INT -FK - - -number -NVARCHAR(100) - - -type -NVARCHAR(100) - - -external_number? -NVARCHAR(100) - - -date -DATETIME2 - - -created_at -DATETIME2 + + + + + + + + + + +manifest + + +id +INT +PK + + +company_id +INT +FK + + +entity_id +? +INT +FK + + +number +NVARCHAR(100) + + +type +NVARCHAR(100) + + +external_number? +NVARCHAR(100) + + +date +DATETIME2 + + +created_at +DATETIME2 -manifestattachment:se->manifest:n +manifestattachment:sw->manifest:n - - + + - + -package - - -package - - -id -INT -PK - - -entityaddress_id -INT -FK - - -shipping_id -INT -FK - - -number -NVARCHAR(100) - - -type -NVARCHAR(100) - - -state -NVARCHAR(100) - - -details? -NVARCHAR(MAX) +ledger + + +ledger + + +id +INT +PK + + +manifestarticle_id +INT +FK + + +warehouse_id +? +INT +FK + + +transaction_type +NVARCHAR(100) + + +amount +FLOAT + + +transaction_text +NVARCHAR(MAX) + + +hash_version +INT + + +prev_hash? +NVARCHAR(128) + + +created_at +DATETIME2 - - -package:w->entityaddress:n - - - + + +manifestarticle + + + +manifestarticle + + +id +INT +PK + + +manifest_id +INT +FK + + +sku? +NVARCHAR(100) + + +name? +NVARCHAR(255) + + +pu +FLOAT + + +amount +FLOAT + + +net +FLOAT + + +comment? +NVARCHAR(MAX) + + +rebate +FLOAT + + +taxrate +FLOAT + + + +ledger:sw->manifestarticle:n + + + - - -shipping - - - -shipping - - -id -INT -PK - - -manifest_id -INT -FK - - -number -NVARCHAR(100) - - -tracking_code? -NVARCHAR(255) - - -carrier? -NVARCHAR(100) - - -type -NVARCHAR(100) - - -state -NVARCHAR(100) + + +warehouse + + + +warehouse + + +id +INT +PK + + +company_id +INT +FK + + +name +NVARCHAR(255) + + +sort +INT - - -package:se->shipping:n - - - - - - - - -manifest:w->entity:n - - - + + +ledger:e->warehouse:n + + + @@ -2095,261 +2134,259 @@ manifest:w->company:n - - + + - - -manifestarticle - - - -manifestarticle - - -id -INT -PK - - -manifest_id -INT -FK - - -sku? -NVARCHAR(100) - - -name? -NVARCHAR(255) - - -pu -FLOAT - - -amount -FLOAT - - -net -FLOAT - - -comment? -NVARCHAR(MAX) - - -rebate -FLOAT - - -taxrate -FLOAT + + +manifest:e->entity:n + + + + + manifestarticle:sw->manifest:n - - + + - - -ledger - - -ledger - - -id -INT -PK - - -manifestarticle_id -INT -FK - - -warehouse_id -? -INT -FK - - -transaction_type -NVARCHAR(100) - - -amount -FLOAT - - -transaction_text -NVARCHAR(MAX) - - -hash_version -INT - - -prev_hash? -NVARCHAR(128) - - -created_at -DATETIME2 - - - -ledger:nw->manifestarticle:n - - - + + +warehouse:e->company:n + + + - - -warehouse - - - -warehouse - - -id -INT -PK - - -company_id -INT -FK - - -name -NVARCHAR(255) - - -sort -INT + + +quotesummary + + +quotesummary + + +id +INT +PK + + +manifest_id +INT +FK + + +company_id +INT +FK + + +entity_id +? +INT +FK + + +quote_number +NVARCHAR(100) + + +quote_date +DATETIME2 + + +created_at +DATETIME2 + + +customer_name? +NVARCHAR(255) + + +positions +INT + + +gross_total +FLOAT + + +total_quantity +FLOAT - - -ledger:w->warehouse:n - - - + + +quotesummary:e->company:n + + + + + +quotesummary:e->entity:n + + + + + + + + +quotesummary:nw->manifest:n + + + + + + + + +shipping + + + +shipping + + +id +INT +PK + + +manifest_id +INT +FK + + +number +NVARCHAR(100) + + +tracking_code? +NVARCHAR(255) + + +carrier? +NVARCHAR(100) + + +type +NVARCHAR(100) + + +state +NVARCHAR(100) + -shipping:sw->manifest:n +shipping:w->manifest:n - - + + - + shipmentsummary - - -shipmentsummary - - -id -INT -PK - - -entity_id -? -INT -FK - - -company_id -INT -FK - - -manifest_id -INT -FK - - -shipment_number -NVARCHAR(100) - - -shipment_date -DATETIME2 - - -created_at -DATETIME2 - - -order_id? -INT - - -order_number? -NVARCHAR(100) - - -customer_name? -NVARCHAR(255) - - -positions -INT - - -total_quantity -FLOAT - - -package_count -INT - - -carrier? -NVARCHAR(100) - - -tracking_code? -NVARCHAR(255) - - -state -NVARCHAR(50) - - - -shipmentsummary:w->entity:n - - - - - + + +shipmentsummary + + +id +INT +PK + + +manifest_id +INT +FK + + +company_id +INT +FK + + +entity_id +? +INT +FK + + +shipment_number +NVARCHAR(100) + + +shipment_date +DATETIME2 + + +created_at +DATETIME2 + + +order_id? +INT + + +order_number? +NVARCHAR(100) + + +customer_name? +NVARCHAR(255) + + +positions +INT + + +total_quantity +FLOAT + + +package_count +INT + + +carrier? +NVARCHAR(100) + + +tracking_code? +NVARCHAR(255) + + +state +NVARCHAR(50) -shipmentsummary:e->company:n +shipmentsummary:se->company:n - - + + + + + + + +shipmentsummary:e->entity:n + + + @@ -2357,127 +2394,118 @@ shipmentsummary:sw->manifest:n - - - - - - - -warehouse:w->company:n - - - + + deliverysummary - - -deliverysummary - - -id -INT -PK - - -supplier_id -? -INT -FK - - -company_id -INT -FK - - -manifest_id -INT -FK - - -delivery_number -NVARCHAR(100) - - -external_number? -NVARCHAR(100) - - -delivery_date -DATETIME2 - - -created_at -DATETIME2 - - -supplier_name? -NVARCHAR(255) - - -positions -INT - - -gross_total -FLOAT - - -net_total -FLOAT - - -total_quantity -FLOAT - - -stock_positions -INT - - -booked_positions -INT - - -unbooked_positions -INT - - -stock_quantity -FLOAT - - -booked_quantity -FLOAT - - -unbooked_quantity -FLOAT - - -is_booked -TINYINT - - - -deliverysummary:w->entity:n - - - - - + + +deliverysummary + + +id +INT +PK + + +manifest_id +INT +FK + + +company_id +INT +FK + + +supplier_id +? +INT +FK + + +delivery_number +NVARCHAR(100) + + +external_number? +NVARCHAR(100) + + +delivery_date +DATETIME2 + + +created_at +DATETIME2 + + +supplier_name? +NVARCHAR(255) + + +positions +INT + + +gross_total +FLOAT + + +net_total +FLOAT + + +total_quantity +FLOAT + + +stock_positions +INT + + +booked_positions +INT + + +unbooked_positions +INT + + +stock_quantity +FLOAT + + +booked_quantity +FLOAT + + +unbooked_quantity +FLOAT + + +is_booked +TINYINT -deliverysummary:e->company:n +deliverysummary:se->company:n - - + + + + + + + +deliverysummary:e->entity:n + + + @@ -2485,98 +2513,154 @@ deliverysummary:sw->manifest:n - - + + + + + + + +package + + +package + + +id +INT +PK + + +shipping_id +INT +FK + + +entityaddress_id +INT +FK + + +number +NVARCHAR(100) + + +type +NVARCHAR(100) + + +state +NVARCHAR(100) + + +details? +NVARCHAR(MAX) + + + +package:e->entityaddress:n + + + + + + + + +package:e->shipping:n + + + - + ordersummary - - -ordersummary - - -id -INT -PK - - -entity_id -? -INT -FK - - -company_id -INT -FK - - -manifest_id -INT -FK - - -order_number -NVARCHAR(100) - - -order_date -DATETIME2 - - -created_at -DATETIME2 - - -customer_name? -NVARCHAR(255) - - -positions -INT - - -gross_total -FLOAT - - -paid_total -FLOAT - - -ordered_quantity -FLOAT - - -shipped_quantity -FLOAT - - -is_paid -TINYINT - - -is_shipped -TINYINT - - - -ordersummary:w->entity:n - - - - - + + +ordersummary + + +id +INT +PK + + +manifest_id +INT +FK + + +company_id +INT +FK + + +entity_id +? +INT +FK + + +order_number +NVARCHAR(100) + + +order_date +DATETIME2 + + +created_at +DATETIME2 + + +customer_name? +NVARCHAR(255) + + +positions +INT + + +gross_total +FLOAT + + +paid_total +FLOAT + + +ordered_quantity +FLOAT + + +shipped_quantity +FLOAT + + +is_paid +TINYINT + + +is_shipped +TINYINT -ordersummary:e->company:n +ordersummary:se->company:n - - + + + + + + + +ordersummary:e->entity:n + + + @@ -2584,227 +2668,144 @@ ordersummary:w->manifest:n - - - - - - - -quotesummary - - -quotesummary - - -id -INT -PK - - -entity_id -? -INT -FK - - -company_id -INT -FK - - -manifest_id -INT -FK - - -quote_number -NVARCHAR(100) - - -quote_date -DATETIME2 - - -created_at -DATETIME2 - - -customer_name? -NVARCHAR(255) - - -positions -INT - - -gross_total -FLOAT - - -total_quantity -FLOAT - - - -quotesummary:w->entity:n - - - - - - - - -quotesummary:e->company:n - - - - - - - - -quotesummary:w->manifest:n - - - + + price - - -price - - -id -INT -PK - - -customergroup_id -INT -FK - - -article_id -INT -FK - - -tax_id -INT -FK - - -minmultiplier -DECIMAL(18,4) - - -net -FLOAT + + +price + + +id +INT +PK + + +article_id +INT +FK + + +tax_id +INT +FK + + +customergroup_id +INT +FK + + +minmultiplier +DECIMAL(18,4) + + +net +FLOAT price:e->customergroup:n - - + + -price:e->article:n +price:w->article:n - - + + -price:w->tax:n +price:e->tax:n - - + + account - - - -account - - -id -INT -PK - - -company_id -INT -FK - - -type -NVARCHAR(100) - - -name -NVARCHAR(255) + + + +account + + +id +INT +PK + + +company_id +INT +FK + + +type +NVARCHAR(100) + + +name +NVARCHAR(255) -account:w->company:n +account:e->company:n - - + + payment - - -payment - - -id -INT -PK - - -account_id -INT -FK - - -manifest_id -INT -FK - - -type -NVARCHAR(100) - - -amount -FLOAT + + +payment + + +id +INT +PK + + +account_id +INT +FK + + +manifest_id +INT +FK + + +type +NVARCHAR(100) + + +amount +FLOAT payment:se->manifest:n - - + + @@ -2812,8 +2813,8 @@ payment:w->account:n - - + + @@ -2821,108 +2822,108 @@ unit:w->company:n - - + + posterminalcategory - - -posterminalcategory - - -id -INT -PK - - -category_id -INT -FK - - -posterminal_id -INT -FK + + +posterminalcategory + + +id +INT +PK + + +category_id +INT +FK + + +posterminal_id +INT +FK -posterminalcategory:w->category:n +posterminalcategory:e->category:n - - + + posterminal - - - -posterminal - - -id -INT -PK - - -company_id -INT -FK - - -root_category_id -? -INT -FK - - -name -NVARCHAR(255) - - -token? -NVARCHAR(255) - - -pairingpin? -NVARCHAR(50) - - -paired_at? -DATETIME2 - - -clientserial? -NVARCHAR(255) - - -maxknowntombstoneid? -INT - - -sync_root_articles -BIT - - -lastseen_at? -DATETIME2 - - -updated_at -DATETIME2 + + + +posterminal + + +id +INT +PK + + +root_category_id +? +INT +FK + + +company_id +INT +FK + + +name +NVARCHAR(255) + + +token? +NVARCHAR(255) + + +pairingpin? +NVARCHAR(50) + + +paired_at? +DATETIME2 + + +clientserial? +NVARCHAR(255) + + +maxknowntombstoneid? +INT + + +sync_root_articles +BIT + + +lastseen_at? +DATETIME2 + + +updated_at +DATETIME2 posterminalcategory:se->posterminal:n - - + + @@ -2930,8 +2931,8 @@ posterminal:e->company:n - - + + @@ -2939,484 +2940,365 @@ posterminal:w->category:n - - + + printer - - -printer - - -id -INT -PK - - -company_id -INT -FK - - -address -NVARCHAR(255) - - -type -NVARCHAR(50) - - -model? -NVARCHAR(255) - - -serial? -NVARCHAR(255) - - -sort -INT - - -desc? -NVARCHAR(MAX) + + +printer + + +id +INT +PK + + +company_id +INT +FK + + +address +NVARCHAR(255) + + +type +NVARCHAR(50) + + +model? +NVARCHAR(255) + + +serial? +NVARCHAR(255) + + +sort +INT + + +desc? +NVARCHAR(MAX) printer:w->company:n - - + + labeltemplate - - -labeltemplate - - -id -INT -PK - - -company_id -INT -FK - - -name -NVARCHAR(255) - - -width -INT - - -height -INT - - -dpi -INT - - -type -NVARCHAR(50) - - -content -NVARCHAR(MAX) - - -thumb? -VARBINARY(MAX) + + +labeltemplate + + +id +INT +PK + + +company_id +INT +FK + + +name +NVARCHAR(255) + + +width +INT + + +height +INT + + +dpi +INT + + +type +NVARCHAR(50) + + +content +NVARCHAR(MAX) + + +thumb? +VARBINARY(MAX) -labeltemplate:w->company:n +labeltemplate:e->company:n - - + + modelvfs - - -modelvfs - - -id -INT -PK - - -company_id -INT -FK - - -name -NVARCHAR(255) - - -mime -NVARCHAR(100) - - -content -VARBINARY(MAX) - - -meta -NVARCHAR(MAX) - - -created_at -DATETIME2 - - -updated_at -DATETIME2 + + +modelvfs + + +id +INT +PK + + +company_id +INT +FK + + +name +NVARCHAR(255) + + +mime +NVARCHAR(100) + + +content +VARBINARY(MAX) + + +meta +NVARCHAR(MAX) + + +created_at +DATETIME2 + + +updated_at +DATETIME2 -modelvfs:e->company:n +modelvfs:sw->company:n - - + + modelconversation - - - -modelconversation - - -id -INT -PK - - -companyuser_id -INT -FK - - -provider -NVARCHAR(100) - - -model -NVARCHAR(255) - - -created_at -DATETIME2 - - -updated_at -DATETIME2 - - -state -NVARCHAR(20) - - -started_by? -INT + + + +modelconversation + + +id +INT +PK + + +companyuser_id +INT +FK + + +provider +NVARCHAR(100) + + +model +NVARCHAR(255) + + +created_at +DATETIME2 + + +updated_at +DATETIME2 + + +state +NVARCHAR(20) + + +started_by? +INT modelconversation:e->companyuser:n - - + + modelmessage - - -modelmessage - - -id -INT -PK - - -conversation_id -INT -FK - - -created_at -DATETIME2 - - -role -NVARCHAR(20) - - -message -NVARCHAR(MAX) + + +modelmessage + + +id +INT +PK + + +conversation_id +INT +FK + + +created_at +DATETIME2 + + +role +NVARCHAR(20) + + +message +NVARCHAR(MAX) modelmessage:sw->modelconversation:n - - - - - - - -propertyname - - - - -propertyname - - -id -INT -PK - - -company_id -INT -FK - - -name -NVARCHAR(255) - - -sort -INT - - -exclusive -BIT - - - -propertyname:nw->company:n - - - - - - - - -attributename:w->company:n - - - - - - - - -attributevalue:sw->attributename:n - - - - - - - - -categoryproperty - - -categoryproperty - - -id -INT -PK - - -property_id -INT -FK - - -category_id -INT -FK - - -value -NVARCHAR(MAX) - - -sort -INT - - - -categoryproperty:e->category:n - - - - - - - - -categoryproperty:w->propertyname:n - - - - - - - - -categoryattributevalue - - -categoryattributevalue - - -id -INT -PK - - -attributevalue_id -INT -FK - - -category_id -INT -FK - - -sort -INT - - - -categoryattributevalue:e->category:n - - - - - - - - -categoryattributevalue:w->attributevalue:n - - - + + - + articleproperty - - -articleproperty - - -id -INT -PK - - -property_id -INT -FK - - -article_id -INT -FK - - -value -NVARCHAR(MAX) - - -sort -INT + + +articleproperty + + +id +INT +PK + + +article_id +INT +FK + + +property_id +INT +FK + + +value +NVARCHAR(MAX) + + +sort +INT -articleproperty:w->article:n +articleproperty:e->article:n - - + + + + +propertyname + + + + +propertyname + + +id +INT +PK + + +company_id +INT +FK + + +name +NVARCHAR(255) + + +sort +INT + + +exclusive +BIT + articleproperty:w->propertyname:n - - + + - + articleattributevalue - - -articleattributevalue - - -id -INT -PK - - -attributevalue_id -INT -FK - - -article_id -INT -FK - - -sort -INT + + +articleattributevalue + + +id +INT +PK + + +article_id +INT +FK + + +attributevalue_id +INT +FK + + +sort +INT -articleattributevalue:w->article:n +articleattributevalue:e->article:n - - + + @@ -3424,190 +3306,367 @@ articleattributevalue:w->attributevalue:n - - + + - - -mcp_token - - -mcp_token - - -id -INT -PK - - -google_auth_id -INT -FK - - -refresh_token -NVARCHAR(128) - - -client_id -NVARCHAR(100) - - -scope? -NVARCHAR(255) - - -expires_at -DATETIME2 - - -revoked -TINYINT - - -created_at -DATETIME2 + + +categoryproperty + + +categoryproperty + + +id +INT +PK + + +category_id +INT +FK + + +property_id +INT +FK + + +value +NVARCHAR(MAX) + + +sort +INT - - -mcp_token:e->google_auth:n - - - + + +categoryproperty:w->category:n + + + - - -mcp_auth_code - - -mcp_auth_code - - -code -NVARCHAR(128) -PK - - -google_auth_id -INT -FK - - -client_id -NVARCHAR(100) - - -redirect_uri -NVARCHAR(2048) - - -code_challenge -NVARCHAR(255) - - -code_challenge_method -NVARCHAR(32) - - -scope? -NVARCHAR(255) - - -expires_at -DATETIME2 - - -used -TINYINT - - -created_at -DATETIME2 + + +categoryproperty:e->propertyname:n + + + + - - -mcp_auth_code:e->google_auth:n - - - + + + +categoryattributevalue + + +categoryattributevalue + + +id +INT +PK + + +category_id +INT +FK + + +attributevalue_id +INT +FK + + +sort +INT + + + +categoryattributevalue:w->category:n + + + + + + + + +categoryattributevalue:e->attributevalue:n + + + + + + + + +attributevalue:se->attributename:n + + + + + + + + +attributename:e->company:n + + + + + + + + +propertyname:e->company:n + + + - + mcp_client - - -mcp_client - - -id -INT -PK - - -client_id -NVARCHAR(100) - - -client_secret? -NVARCHAR(255) - - -client_name -NVARCHAR(255) - - -redirect_uris -NVARCHAR(MAX) - - -grant_types? -NVARCHAR(255) - - -response_types? -NVARCHAR(255) - - -scope? -NVARCHAR(255) - - -created_at -DATETIME2 + + +mcp_client + + +id +INT +PK + + +client_id +NVARCHAR(100) + + +client_secret? +NVARCHAR(255) + + +client_name +NVARCHAR(255) + + +redirect_uris +NVARCHAR(MAX) + + +grant_types? +NVARCHAR(255) + + +response_types? +NVARCHAR(255) + + +scope? +NVARCHAR(255) + + +created_at +DATETIME2 + + + +mcp_token + + +mcp_token + + +id +INT +PK + + +google_auth_id +INT +FK + + +refresh_token +NVARCHAR(128) + + +client_id +NVARCHAR(100) + + +scope? +NVARCHAR(255) + + +expires_at +DATETIME2 + + +revoked +TINYINT + + +created_at +DATETIME2 + + + +mcp_token:sw->google_auth:n + + + + + + + + +mcp_auth_code + + +mcp_auth_code + + +code +NVARCHAR(128) +PK + + +google_auth_id +INT +FK + + +client_id +NVARCHAR(100) + + +redirect_uri +NVARCHAR(2048) + + +code_challenge +NVARCHAR(255) + + +code_challenge_method +NVARCHAR(32) + + +scope? +NVARCHAR(255) + + +expires_at +DATETIME2 + + +used +TINYINT + + +created_at +DATETIME2 + + + +mcp_auth_code:sw->google_auth:n + + + + + + + + +subagentschedule + + +subagentschedule + + +id +INT +PK + + +company_id +INT +FK + + +desc? +NVARCHAR(MAX) + + +prompt +NVARCHAR(MAX) + + +skills? +NVARCHAR(MAX) + + +lastagentnote? +NVARCHAR(MAX) + + +max_itr +INT + + +cron +NVARCHAR(100) + + +created_at +DATETIME2 + + +lastrun_at? +DATETIME2 + + + +subagentschedule:w->company:n + + + + + - + __legend - - - -Legend - -PK - -primary key - -FK - -foreign key - -? - -nullable column - -— - -FOREIGN KEY constraint - -- - - -naming convention only, no constraint + + + +Legend + +PK + +primary key + +FK + +foreign key + +? + +nullable column + +— + +FOREIGN KEY constraint + +- - + +naming convention only, no constraint diff --git a/src/providers/mssql/schema.js b/src/providers/mssql/schema.js index 8d69752..86f62fc 100644 --- a/src/providers/mssql/schema.js +++ b/src/providers/mssql/schema.js @@ -1376,6 +1376,26 @@ BEGIN END `; +export const INIT_SUBAGENTSCHEDULE = ` +IF NOT EXISTS (SELECT * FROM sys.tables WHERE name = 'subagentschedule') +BEGIN + CREATE TABLE subagentschedule ( + id INT IDENTITY(1,1) PRIMARY KEY, + company_id INT NOT NULL, + [desc] NVARCHAR(MAX) NULL, + prompt NVARCHAR(MAX) NOT NULL, + skills NVARCHAR(MAX) NULL, + lastagentnote NVARCHAR(MAX) NULL, + max_itr INT NOT NULL CONSTRAINT DF_subagentschedule_max_itr DEFAULT 15, + cron NVARCHAR(100) NOT NULL, + created_at DATETIME2 NOT NULL CONSTRAINT DF_subagentschedule_created_at DEFAULT SYSUTCDATETIME(), + lastrun_at DATETIME2 NULL, + CONSTRAINT FK_subagentschedule_company FOREIGN KEY (company_id) REFERENCES company(id) ON DELETE CASCADE + ); + CREATE INDEX IX_subagentschedule_company ON subagentschedule (company_id); +END +`; + /** DDL scripts in dependency order for schema init. */ export const SCHEMA_SCRIPTS = [ INIT_META, @@ -1450,4 +1470,5 @@ export const SCHEMA_SCRIPTS = [ INIT_MCP_CLIENT, INIT_MCP_AUTH_CODE, INIT_MCP_TOKEN, + INIT_SUBAGENTSCHEDULE, ]; diff --git a/src/providers/sqlite3/schema.js b/src/providers/sqlite3/schema.js index ee3dbcf..a6a4f85 100644 --- a/src/providers/sqlite3/schema.js +++ b/src/providers/sqlite3/schema.js @@ -1011,6 +1011,23 @@ CREATE TABLE IF NOT EXISTS mcp_token ( ); `; +export const INIT_SUBAGENTSCHEDULE = ` +CREATE TABLE IF NOT EXISTS subagentschedule ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + company_id INTEGER NOT NULL, + "desc" TEXT, + prompt TEXT NOT NULL, + skills TEXT, + lastagentnote TEXT, + max_itr INTEGER NOT NULL DEFAULT 15, + cron TEXT NOT NULL, + created_at TEXT NOT NULL DEFAULT (${UTC_NOW}), + lastrun_at TEXT, + FOREIGN KEY (company_id) REFERENCES company(id) ON DELETE CASCADE +); +CREATE INDEX IF NOT EXISTS IX_subagentschedule_company ON subagentschedule (company_id); +`; + /** DDL scripts in dependency order for SQLite schema initialization. */ export const SCHEMA_SCRIPTS = [ INIT_META, @@ -1082,4 +1099,5 @@ export const SCHEMA_SCRIPTS = [ INIT_MCP_CLIENT, INIT_MCP_AUTH_CODE, INIT_MCP_TOKEN, + INIT_SUBAGENTSCHEDULE, ];