Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

db-migrator

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

db-migrator - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

35

doc/db-migrate.js
'use strict'
/* eslint-disable no-console, no-process-exit, no-process-env */
const migrate = require('db-migrator/lib/migrate')
const status = require('db-migrator/lib/status')
const dotenv = require('dotenv')
const co = require('co')
const path = require('path')

@@ -15,9 +16,5 @@

case 'staging':
envFile = '.env-heroku-staging'
break
case 'production':
envFile = '.env-heroku-production'
break
case 'dev':
envFile = '.env-heroku-dev'
envFile = `.env-heroku-${env}`
break

@@ -29,7 +26,6 @@ default:

dotenv.config({
path: path.join(__dirname, envFile)
path: path.join(__dirname, envFile),
})
const DB_URL = (process.env.PG_URL || process.env.DATABASE_URL) + '?ssl=true'
if (!DB_URL) {
if (!process.env.DATABASE_URL) {
console.error('DB connection string not defined.')

@@ -39,17 +35,20 @@ process.exit(1)

co(function*() {
yield status({
const DB_URL = `${process.env.DATABASE_URL}?ssl=true`
async function run() {
await status({
connectionString: DB_URL,
path: './migrations',
tableName: 'migrations'
tableName: 'migrations',
})
yield migrate({
await migrate({
connectionString: DB_URL,
path: './migrations',
tableName: 'migrations'
tableName: 'migrations',
})
console.log(envFile, 'migrated')
process.exit(0)
}).catch(function () {
process.exit(1)
})
}
run()
.then(() => process.exit(0))
.catch(() => process.exit(1))
{
"name": "db-migrator",
"description": "The complete and easy to use database migration tool",
"version": "2.0.3",
"version": "2.0.4",
"bin": {

@@ -6,0 +6,0 @@ "db-migrate": "bin/db-migrate",

@@ -78,3 +78,3 @@ DB Migrator

Check out [this document](docs/CONFIGURATION.md) to find out more.
Check out [this document](doc/CONFIGURATION.md) to find out more.

@@ -81,0 +81,0 @@ ## Common Pitfalls

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc