db-migrate
Advanced tools
Comparing version 0.2.7 to 0.2.8
@@ -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) |
@@ -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" |
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
100311
1426