Skip to content

Commit

Permalink
Merge pull request #11 from lelouvincx/feat/2/factory-pattern-tables
Browse files Browse the repository at this point in the history
#2: Update docs
  • Loading branch information
lelouvincx authored Sep 23, 2023
2 parents 51c6084 + 0c0cb51 commit db7ca2f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
4 changes: 2 additions & 2 deletions database-replication/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ app-requirements:
rm app/requirements.txt && \
pip freeze > app/requirements.txt

docs:
db-docs:
dbdocs build docs/wideworldimporters.dbml

format:
Expand All @@ -49,7 +49,7 @@ lint:
test:
python -m pytest --log-cli-level info -p no:warnings -v ./app

ci: docs app-requirements lint format
ci: db-docs app-requirements format lint

# ============ Postgres ============
to-psql-default:
Expand Down
32 changes: 21 additions & 11 deletions database-replication/docs/wideworldimporters.dbml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ Project WideWorldImporters {

These schemas contain the data. Many tables are needed by all other schemas and are located in the Application schema.

| Schema | Description |
| --- | ----------- |
| Application | Application-wide users, contacts, and parameters. This schema also contains reference tables with data that is used by multiple schemas |
| Purchasing | Stock item purchases from suppliers and details about suppliers. |
| Sales | Stock item sales to retail customers, and details about customers and sales people. |
| Warehouse | Stock item inventory and transactions. |
| Website | All access to the database from the company website is through this schema. |
| Reports | All access to the database from Reporting Services reports is through this schema. |
| PowerBI | All access to the database from the Power BI dashboards via the Enterprise Gateway is through this schema. |
| Integration | Objects and procedures required for data warehouse integration (that is, migrating the data to the WideWorldImportersDW database). |
| Sequences | Holds sequences used by all tables in the application. |
| Schema | Description | Status
| --- | ----------- | ---
| Application | Application-wide users, contacts, and parameters. This schema also contains reference tables with data that is used by multiple schemas | In use
| Purchasing | Stock item purchases from suppliers and details about suppliers. | In use
| Sales | Stock item sales to retail customers, and details about customers and sales people. | In use
| Warehouse | Stock item inventory and transactions. | In use
| Public | Public schema to hold dump tables | In use
| Website | All access to the database from the company website is through this schema. | Idle
| Reports | All access to the database from Reporting Services reports is through this schema. | Idle
| PowerBI | All access to the database from the Power BI dashboards via the Enterprise Gateway is through this schema. | Idle
| Integration | Objects and procedures required for data warehouse integration (that is, migrating the data to the WideWorldImportersDW database). | Idle
| Sequences | Holds sequences used by all tables in the application. | Idle

'''
}
Expand Down Expand Up @@ -458,6 +459,15 @@ TABLE Warehouse.stock_items {
note: "Main entity table for stock items"
}

TABLE Public.test {
id integer [primary key]
name varchar(20)
address varchar(100)
zipcode char(5)
introduction text
note: "Sample table"
}

Ref: Application.cities.last_edited_by > Application.people.person_id
Ref: Application.cities.state_province_id > Application.state_provinces.state_province_id
Ref: Application.countries.last_edited_by > Application.people.person_id
Expand Down

0 comments on commit db7ca2f

Please sign in to comment.