fix: replace serial with uuid and remove incorrect promise handling

This commit is contained in:
José Oliveira 2021-04-05 13:39:43 +01:00 committed by Josh Harvey
parent d9ffca8a35
commit af53949ef9
2 changed files with 1 additions and 3 deletions

View file

@ -13,8 +13,6 @@ function createCashboxBatch (rec) {
const newBatch = await t.oneOrNone(sql, [rec.deviceId]) const newBatch = await t.oneOrNone(sql, [rec.deviceId])
return t.oneOrNone(sql2, [newBatch.id, newBatch.device_id]) return t.oneOrNone(sql2, [newBatch.id, newBatch.device_id])
}) })
.then(data => data)
.catch(error => error)
} }
module.exports = { createCashboxBatch } module.exports = { createCashboxBatch }

View file

@ -3,7 +3,7 @@ var db = require('./db')
exports.up = function (next) { exports.up = function (next) {
var sqls = [ var sqls = [
`create table cashbox_batches ( `create table cashbox_batches (
id serial PRIMARY KEY, id uuid PRIMARY KEY,
device_id text REFERENCES devices (device_id), device_id text REFERENCES devices (device_id),
created timestamptz NOT NULL default now() created timestamptz NOT NULL default now()
)`, )`,