Socket
Socket
Sign inDemoInstall

db-migrate

Package Overview
Dependencies
Maintainers
1
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 0.2.7 to 0.2.8

5

CHANGELOG.md

@@ -89,1 +89,6 @@ ## 0.1.0

- Support process.env.DATABASE_URL for postgres, for use with Heroku #57 (via @garth)
## 0.2.8
Improvement
- Added support for additional MySQL data types #58 (via @jpravetz)

4

lib/data_type.js

@@ -7,3 +7,5 @@ module.exports = {

DATE_TIME: 'datetime',
BLOB: 'blob'
BLOB: 'blob',
TIMESTAMP: 'timestamp',
BINARY: 'binary'
};

@@ -33,2 +33,6 @@ var util = require('util');

return 'BLOB';
case type.TIMESTAMP:
return 'TIMESTAMP';
case type.BINARY:
return 'BINARY';
default:

@@ -35,0 +39,0 @@ var unknownType = str.toUpperCase();

@@ -27,2 +27,6 @@ var util = require('util');

return 'BLOB';
case type.TIMESTAMP:
return 'TIMESTAMP';
case type.BINARY:
return 'BINARY';
default:

@@ -45,6 +49,10 @@ throw new Error('Invalid data type ' + str);

var constraint = [];
if (spec.unsigned) {
constraint.push('UNSIGNED');
}
if (spec.primaryKey && options.emitPrimaryKey) {
constraint.push('PRIMARY KEY');
if (spec.autoIncrement) {
constraint.push('auto_increment');
constraint.push('AUTO_INCREMENT');
}

@@ -61,6 +69,10 @@ }

if (spec.null) {
constraint.push('NULL');
}
if (spec.defaultValue) {
constraint.push('DEFAULT');
if (typeof spec.defaultValue == 'string'){
if (typeof spec.defaultValue === 'string'){
constraint.push("'" + spec.defaultValue + "'");

@@ -67,0 +79,0 @@ } else {

@@ -14,3 +14,3 @@ {

],
"version": "0.2.7",
"version": "0.2.8",
"engines": {

@@ -17,0 +17,0 @@ "node": ">=0.6.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