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/20131110070850-add-orders.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/20131110070850-add-orders.js')
| -rw-r--r-- | migrations/20131110070850-add-orders.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/migrations/20131110070850-add-orders.js b/migrations/20131110070850-add-orders.js index b0a7d474..e6f94246 100644 --- a/migrations/20131110070850-add-orders.js +++ b/migrations/20131110070850-add-orders.js @@ -4,7 +4,7 @@ var type = dbm.dataType; exports.up = function(db, callback) { async.series([ - db.createTable('orders', { + db.createTable.bind(db, 'orders', { id: { type: 'int', primaryKey: true, autoIncrement: true }, merchant_id: { type: 'int' }, amount: { type: 'decimal' }, @@ -13,8 +13,8 @@ exports.up = function(db, callback) { creation_time: { type: 'datetime' }, expiration_time: { type: 'datetime' } }), - db.runSql('ALTER TABLE orders ALTER COLUMN amount type decimal(10,2);'), - db.runSql('ALTER TABLE orders ALTER COLUMN rate type decimal(10,2);') + db.runSql.bind(db, 'ALTER TABLE orders ALTER COLUMN amount type decimal(10,2);'), + db.runSql.bind(db, 'ALTER TABLE orders ALTER COLUMN rate type decimal(10,2);') ], callback); }; |
