diff options
| author | Adam Soltys <[email protected]> | 2013-11-14 09:34:51 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2013-11-14 09:34:51 -0800 |
| commit | 8e6b6805c4bc8493f8108f896ccf4f67dbd0b95d (patch) | |
| tree | ac54d4709e6055492a5d442ac4db50a9f4dc175c /migrations/20131110070913-add-settlements.js | |
| parent | 3ce3847a265b08789a7465d0ab7ec8cf903a81a7 (diff) | |
| download | coinos-server-8e6b6805c4bc8493f8108f896ccf4f67dbd0b95d.tar.gz coinos-server-8e6b6805c4bc8493f8108f896ccf4f67dbd0b95d.zip | |
Use async to run migration commands in series
Diffstat (limited to 'migrations/20131110070913-add-settlements.js')
| -rw-r--r-- | migrations/20131110070913-add-settlements.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/migrations/20131110070913-add-settlements.js b/migrations/20131110070913-add-settlements.js index 7c835f87..c66ee863 100644 --- a/migrations/20131110070913-add-settlements.js +++ b/migrations/20131110070913-add-settlements.js @@ -1,17 +1,19 @@ var dbm = require('db-migrate'); +var async = require('async'); var type = dbm.dataType; exports.up = function(db, callback) { - db.createTable('settlements', { + async.series([ + db.createTable.bind(db, 'settlements', { id: { type: 'int', primaryKey: true, autoIncrement: true }, settler_id: { type: 'int' }, merchant_id: { type: 'int' }, amount: { type: 'decimal' }, date: { type: 'datetime' }, method: { type: 'string' } - }, callback); - - db.runSql('ALTER TABLE settlements ALTER COLUMN amount type decimal(10,2);'); + }), + db.runSql.bind(db, 'ALTER TABLE settlements ALTER COLUMN amount type decimal(10,2);') + ], callback); }; exports.down = function(db, callback) { |
