Database
Last updated
Last updated
We are using PostgreSQL as our Database for persisting data and Sequalize ORM to simplify the interaction with the database in our Typescript project.
These utility files are named and sorted by date when they were created to ensure consistent and deterministic deployment between multiple different computers or installations.
Sequalize allows us to easily create migrations located in /database/migrations
folder, which allow us to easily recreate the db on new machines, as well to alter the db in the future consistently between multiple machines or team members.
The seeders allow us to pre-fill the data of our tables such as User profiles, Admin profiles, Pallets etc.
Sequalize being in typescript, we can re-use our business logic configuration files and generate table entries dynamically during the setup without repeating our code.
These are the tables that sequalizes internally uses for it's own metadata:
sequalize_meta
sequalize_seed
Tables we use for management of our session cookie
session
Tables for managing users and ther permissions
users
Tables that hold all of the Pallet related data, normalised to 2NF ensure zero data redudancy
pallets: Holds all the pallet metadata
pallet-dependency: Tracks relationships between module dependency of the pallets
pallet-category: Simple table to track which categories a pallet belongs to
pallet-author: Simple table to track Authors of a pallet (There can be multiple)
Tables that hold of the Template related data, normalised to 1NF
templates: Holds all the template metadata
template-dependency: Tracks which pallets a template uses