db-migrate-mysql
Advanced tools
Comparing version 2.2.0 to 2.3.0
16
index.js
@@ -108,4 +108,12 @@ const util = require('util'); | ||
if (spec.characterSet) { | ||
constraint.push(`CHARACTER SET ${spec.characterSet}`); | ||
} | ||
if (spec.collation) { | ||
constraint.push(`COLLATE ${spec.collation}`); | ||
} | ||
if (spec.primaryKey) { | ||
if (!options || options.emitPrimaryKey) { | ||
if (!options || Object.keys(options).length === 0 || options.emitPrimaryKey) { | ||
constraint.push('PRIMARY KEY'); | ||
@@ -511,6 +519,8 @@ } | ||
const { driver, ...connectionOptions } = config; | ||
if (typeof mysql.createConnection === 'undefined') { | ||
db = config.db || mysql.createClient(config); | ||
db = config.db || mysql.createClient(connectionOptions); | ||
} else { | ||
db = config.db || mysql.createConnection(config); | ||
db = config.db || mysql.createConnection(connectionOptions); | ||
} | ||
@@ -517,0 +527,0 @@ |
{ | ||
"name": "db-migrate-mysql", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "db-migrate mysql driver", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25730
13
449