Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}
});
}