How to use the postgrator.setMigrationDirectory 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 codeforamerica / colonel-clark / db / migrator.js View on Github external
var applyMigrations = function(migrationId) {

    console.log("Target migration = " + migrationId);
    
    postgrator.setMigrationDirectory(__dirname + '/migrations');
    postgrator.setConnectionString(process.env.DATABASE_URL || config.db_connection_string);
    postgrator.migrate(migrationId, function(err, migrationsRun) {
	      if (err) {
	          console.error("Error: " + err);
	          process.exit(2);
	      }
    });

}

postgrator

A SQL migration tool for SQL people

MIT
Latest version published 10 months ago

Package Health Score

64 / 100
Full package analysis