Socket
Socket
Sign inDemoInstall

db-migrate

Package Overview
Dependencies
Maintainers
2
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

db-migrate - npm Package Compare versions

Comparing version 1.0.0-beta.14 to 1.0.0-beta.15

24

lib/commands/create-migration.js

@@ -8,4 +8,6 @@ 'use strict';

const stat = Promise.promisify(fs.stat);
const writeFile = Promise.promisify(fs.writeFile);
const yargs = require('yargs');
const util = require('util');
const path = require('path');

@@ -17,6 +19,24 @@ async function createMigrationDir (dir) {

if (res && res.err === true) {
return mkdirp(dir);
await mkdirp(dir);
}
return Promise.resolve();
// Create migrations/package.json to ensure migration files are
// executed as CJS and not ESM
// https://github.com/db-migrate/node-db-migrate/issues/721
const packageJsonPath = path.resolve(dir, 'package.json');
await stat(packageJsonPath).then(
async () => {
const packageJson = require(packageJsonPath);
packageJson.type = 'commonjs';
const packageJsonStr = JSON.stringify(packageJson, null, 2);
await writeFile(packageJsonPath, packageJsonStr, 'utf-8');
},
async (err) => {
const packageJson = JSON.stringify({
type: 'commonjs'
}, null, 2)
await writeFile(packageJsonPath, packageJson, 'utf-8');
}
)
}

@@ -23,0 +43,0 @@

@@ -90,2 +90,12 @@ const Promise = require('bluebird');

if (this.foreign[t]) {
this.modF[n] = this.foreign[n];
delete this.foreign[t];
}
if (this.indizies[t]) {
this.modI[n] = this.indizies[t];
delete this.indizies[t];
}
this.modC.push({ t: 0, a: 'renameTable', c: [n, t] });

@@ -92,0 +102,0 @@

2

package.json

@@ -34,3 +34,3 @@ {

],
"version": "1.0.0-beta.14",
"version": "1.0.0-beta.15",
"engines": {

@@ -37,0 +37,0 @@ "node": ">=8.0.0"

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