diff --git a/lib/cash-out/cash-out-actions.js b/lib/cash-out/cash-out-actions.js index f63b3296..420e0ae9 100644 --- a/lib/cash-out/cash-out-actions.js +++ b/lib/cash-out/cash-out-actions.js @@ -18,7 +18,7 @@ function logActionById (t, action, _rec, txId) { } function logAction (t, action, _rec, tx) { - const rec = _.assign(_rec, {action, tx_id: tx.id, redeem: !!tx.redeem}) + const rec = _.assign(_rec, {action, tx_id: tx.id, redeem: !!tx.redeem, device_id: tx.deviceId}) const sql = pgp.helpers.insert(rec, null, 'cash_out_actions') return t.none(sql) diff --git a/migrations/1536651947391-add-device-id-to-cash-out-actions.js b/migrations/1536651947391-add-device-id-to-cash-out-actions.js new file mode 100644 index 00000000..3a07a6bf --- /dev/null +++ b/migrations/1536651947391-add-device-id-to-cash-out-actions.js @@ -0,0 +1,12 @@ +var db = require('./db') + +exports.up = function (next) { + var sql = [ + "alter table cash_out_actions add device_id text not null default ''" + ] + db.multi(sql, next) +} + +exports.down = function (next) { + next() +}