Skip to Content
ContributingPackagesDBGetting started

DB

This is the database package, it is intended to have the schema definitions and handle the database migrations, we are using Drizzle ORM to handle all of these, please take a look at the documentations and current project files to check what we are doing currenttly.

Note: Please make sure that all schemas have read all of the following documents before starting to code:

General Guidelines

Required Fields

All tables should have the basic tracking fields:

  • createdAt
  • updatedAt
  • isActive
  • createdById
  • updatedById

To keep the data consistent and scalable, please use the spread operator to add the tracking fields to the table. For example:

const user = pgTable('user', { name: varchar('name', { length: 256 }).notNull(), ...TRACKING_FIELDS, })

Table names

Relations

Last updated on