Database

Database

This project can use the most popular SQL databases such as PostgreSQL, MySQL, Oracle, MSSQL and Sqlite. This is achieved with Sequelize, the most popular ORM for Node.js

Install and Start

Start the postgres database and other services:

$ npm run docker:up

Connect to the database:

$ psql "postgres://postgres:password@localhost:6432/dev?sslmode=disable"

Configuration

Here is an example of the configuration for Postgres:

"db":{
    "url": "postgres://postgres:password@localhost:6432/dev?sslmode=disable",
    "options": {
      "logging": true
    }
}

Migration

Database migration are not necessary for development environment but only for system already in production.

Run the following command to migrate the database:

$ npm run db:migrate

Last updated