How to use the postgrator.setConfig function in postgrator

To help you get started, we’ve selected a few postgrator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CoderDojo / cp-dojos-service / migrate-psql-db.js View on Github external
module.exports = function migrate (cb) {
  postgrator.setConfig({
    migrationDirectory: './scripts/database/pg/migrations',
    driver: 'pg',
    host: config['postgresql-store'].host,
    database: config['postgresql-store'].name,
    username: config['postgresql-store'].username,
    password: config['postgresql-store'].password
  });

  postgrator.migrate('max', function (err, migrations) {
    postgrator.endConnection(function () {
      return cb(err, migrations);
    });
  });
};

postgrator

A SQL migration tool for SQL people

MIT
Latest version published 2 months ago

Package Health Score

73 / 100
Full package analysis