Published 2021-02-13.
Last modified 2021-03-28.
Time to read: 1 minutes.
django
collection.
A complete set of standard entity relationship diagrams
for django-oscar
webapps has at least 161 tables.
This is how I counted them:
$ psql -U postgres -h localhost -d frobshop \ -tc "select count(*) as tables from information_schema.tables where table_type = 'BASE TABLE';" 161
I used Dbeaver to create the following entity relationship diagrams of the django-oscar
schema.
There were too many table to examine in one diagram, so I examined them piecemeal.
Update 2021-03-28: When I first saw the table names I could not understand the naming convention.
After having spent some time looking at the source code and playing with the software,
I now believe that a table name is constructed from a Django app name,
concatenated with the corresponding app model's class name, like this:
{appname}_{classname}
.
If a class field joins to another class, the naming convention becomes:
{appname}_{classname}{join_table_name}
The remainder of this article shows most of the 161 django-oscar
tables.
Some tables are shown more than once in the interest of clarity.
address_country
![Centered around the <code>address_country</code> table Centered around the <code>address_country</code> table](/blog/images/django/oscar/erd/address_country_erd.png)
address_country
table
auth_user
![Centered around the <code>auth_user</code> table Centered around the <code>auth_user</code> table](/blog/images/django/oscar/erd/auth_user_erd.png)
auth_user
table
basket_basket
![Centered around the <code>basket_basket</code> table Centered around the <code>basket_basket</code> table](/blog/images/django/oscar/erd/basket_basket_erd.png)
basket_basket
table
catalogue_product
![Centered around the <code>catalogue_product</code> table Centered around the <code>catalogue_product</code> table](/blog/images/django/oscar/erd/catalogue_product_erd.png)
catalogue_product
table
offer_range
![Centered around the <code>offer_range</code> table Centered around the <code>offer_range</code> table](/blog/images/django/oscar/erd/offer_range_erd.png)
offer_range
table
order_order
![Centered around the <code>order_order</code> table Centered around the <code>order_order</code> table](/blog/images/django/oscar/erd/order_order_erd.png)
order_order
table
partner_partner
![Centered around the <code>partner_partner</code> table Centered around the <code>partner_partner</code> table](/blog/images/django/oscar/erd/partner_partner_erd.png)
partner_partner
table
payment_source
![Centered around the <code>payment_source</code> table Centered around the <code>payment_source</code> table](/blog/images/django/oscar/erd/payment_source_erd.png)
payment_source
table
shipping
![Centered around the <code>shipping</code> table Centered around the <code>shipping</code> table](/blog/images/django/oscar/erd/shipping_erd.png)
shipping
table
voucher_voucher
![Centered around the <code>voucher_voucher</code> table Centered around the <code>voucher_voucher</code> table](/blog/images/django/oscar/erd/voucher_voucher_erd.png)
voucher_voucher
table
wishlists_wishlist
![Centered around the <code>wishlists_wishlist</code> table Centered around the <code>wishlists_wishlist</code> table](/blog/images/django/oscar/erd/wishlists_wishlist_erd.png)
wishlists_wishlist
table