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.5.1 to 0.5.2

6

CHANGELOG.md

@@ -154,1 +154,7 @@ ## 0.1.0

- Provide close callback for MySQL driver #107 (via @codeaholics)
## 0.5.2
Fix:
- Add ability to create camel-cased column names for PostgreSQL #111 (via @virpool)
- Add ability to make a unique index #110 (via @codeaholics)

9

lib/driver/base.js

@@ -149,7 +149,12 @@ var util = require('util');

addIndex: function(tableName, indexName, columns, callback) {
addIndex: function(tableName, indexName, columns, unique, callback) {
if (typeof(unique) === 'function') {
callback = unique;
unique = false;
}
if (!Array.isArray(columns)) {
columns = [columns];
}
var sql = util.format('CREATE INDEX %s ON %s (%s)', indexName, tableName, columns.join(', '));
var sql = util.format('CREATE %s INDEX %s ON %s (%s)', (unique ? 'UNIQUE' : ''), indexName, tableName, columns.join(', '));
this.runSql(sql, callback);

@@ -156,0 +161,0 @@ },

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

var constraint = this.createColumnConstraint(spec, options);
return [name, type, len, constraint].join(' ');
return ['"' + name + '"', type, len, constraint].join(' ');
},

@@ -30,0 +30,0 @@

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

],
"version": "0.5.1",
"version": "0.5.2",
"engines": {

@@ -17,0 +17,0 @@ "node": ">=0.6.0"

@@ -27,2 +27,3 @@ # db-migrate

--config Location of the database.json file. [default: "./database.json"]
--force-exit Call system.exit() after migration run [default: false]
```

@@ -334,3 +335,3 @@

### addIndex(tableName, indexName, columns, callback)
### addIndex(tableName, indexName, columns, [unique], callback)

@@ -344,2 +345,3 @@ Add an index

* columns - an array of column names contained in the index
* unique - whether the index is unique (optional, default false)
* callback(err) - callback that will be invoked after adding the index

@@ -346,0 +348,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