Skip to content

database schemas and migrations

zaven edited this page Sep 10, 2020 · 1 revision
  1. Every API repository should target an isolated database schema supporting the services it provides.
  2. The nodejs tool db-migrate should be used to manage database migrations
  3. Migrations should be stored in a directory named 'migrations' in the root folder of the project
  4. Migrations should be managed using scopes in the following way
  5. The default scope should contain all data storage tables, views, indices, constraints, etc
  6. A scope named 'privileges' should be created to contain just GRANT and REVOKE commands guarding access to database tables
  7. Read more about scopes here: https://db-migrate.readthedocs.io/en/latest/Getting%20Started/commands/