Database structure of Lino Shop

This document describes the database structure.

A tested document

This is a tested document. The following instructions are used for initialization:

>>> import lino
>>> lino.startup('lino_shop.projects.shop1.settings')
>>> from lino.api.doctest import *
>>> from lino.utils.diag import analyzer
>>> print(analyzer.show_db_overview())
... 
31 apps: lino, staticfiles, about, jinja, printing, system, contenttypes, gfks, memo, react, shop, users, office, xl, countries, contacts, excerpts, uploads, weasyprint, export_excel, ledger, sepa, products, checkdata, bevat, vat, sales, finan, sheets, shopping, sessions.
59 models:
========================== ============================== ========= =======
 Name                       Default table                  #fields   #rows
-------------------------- ------------------------------ --------- -------
 bevat.Declaration          bevat.Declarations             47        0
 checkdata.Problem          checkdata.Problems             6         1
 contacts.Company           contacts.Companies             26        24
 contacts.CompanyType       contacts.CompanyTypes          7         16
 contacts.Partner           contacts.Partners              24        93
 contacts.Person            contacts.Persons               31        69
 contacts.Role              contacts.Roles                 4         3
 contacts.RoleType          contacts.RoleTypes             5         5
 contenttypes.ContentType   gfks.ContentTypes              3         59
 countries.Country          countries.Countries            6         8
 countries.Place            countries.Places               9         78
 excerpts.Excerpt           excerpts.Excerpts              11        0
 excerpts.ExcerptType       excerpts.ExcerptTypes          17        7
 finan.BankStatement        finan.BankStatements           16        0
 finan.BankStatementItem    finan.BankStatementItemTable   9         0
 finan.JournalEntry         finan.FinancialVouchers        14        0
 finan.JournalEntryItem     finan.JournalEntryItemTable    9         0
 finan.PaymentOrder         finan.PaymentOrders            15        0
 finan.PaymentOrderItem     finan.PaymentOrderItemTable    9         0
 gfks.HelpText              gfks.HelpTexts                 4         2
 ledger.Account             ledger.Accounts                19        20
 ledger.AccountingPeriod    ledger.AccountingPeriods       7         20
 ledger.FiscalYear          ledger.FiscalYears             5         15
 ledger.Journal             ledger.Journals                25        10
 ledger.LedgerInfo          ledger.LedgerInfoTable         2         0
 ledger.MatchRule           ledger.MatchRules              3         33
 ledger.Movement            ledger.Movements               11        0
 ledger.PaymentMethod       ledger.PaymentMethods          5         3
 ledger.PaymentTerm         ledger.PaymentTerms            12        9
 ledger.Voucher             ledger.AllVouchers             8         0
 products.Author            products.Authors               6         2
 products.Book              products.Books                 16        3
 products.Category          products.Categories            7         7
 products.PriceRule         products.PriceRules            3         0
 products.Product           products.Products              13        10
 products.Thing             products.Things                15        4
 sales.InvoiceItem          sales.InvoiceItems             13        0
 sales.PaperType            sales.PaperTypes               5         2
 sales.VatProductInvoice    sales.Invoices                 26        0
 sepa.Account               sepa.Accounts                  6         17
 sessions.Session           users.Sessions                 3         1
 sheets.AccountEntry        sheets.AccountEntries          7         0
 sheets.AnaAccountEntry     sheets.AnaAccountEntries       6         0
 sheets.Item                sheets.Items                   9         29
 sheets.ItemEntry           sheets.ItemEntries             7         0
 sheets.PartnerEntry        sheets.PartnerEntries          8         0
 sheets.Report              sheets.Reports                 6         10
 shopping.Address           shopping.Addresses             13        0
 shopping.Cart              shopping.Carts                 7         0
 shopping.CartItem          shopping.CartItems             4         0
 shopping.DeliveryMethod    shopping.DeliveryMethods       5         3
 system.SiteConfig          system.SiteConfigs             5         1
 uploads.Upload             uploads.Uploads                12        0
 uploads.UploadType         uploads.UploadTypes            8         1
 uploads.Volume             uploads.Volumes                5         0
 users.Authority            users.Authorities              3         0
 users.User                 users.AllUsers                 17        5
 vat.InvoiceItem            vat.InvoiceItemTable           9         0
 vat.VatAccountInvoice      vat.Invoices                   21        0
========================== ============================== ========= =======