From af53949ef9af6d3503f92d4b78d49c78ce43b45d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Oliveira?= Date: Mon, 5 Apr 2021 13:39:43 +0100 Subject: [PATCH] fix: replace serial with uuid and remove incorrect promise handling --- lib/cashbox-batches.js | 2 -- migrations/1616528363530-add_cashbox_batches.js | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/cashbox-batches.js b/lib/cashbox-batches.js index 67cd027c..8c2604e9 100644 --- a/lib/cashbox-batches.js +++ b/lib/cashbox-batches.js @@ -13,8 +13,6 @@ function createCashboxBatch (rec) { const newBatch = await t.oneOrNone(sql, [rec.deviceId]) return t.oneOrNone(sql2, [newBatch.id, newBatch.device_id]) }) - .then(data => data) - .catch(error => error) } module.exports = { createCashboxBatch } diff --git a/migrations/1616528363530-add_cashbox_batches.js b/migrations/1616528363530-add_cashbox_batches.js index fb257e23..d8e8f43b 100644 --- a/migrations/1616528363530-add_cashbox_batches.js +++ b/migrations/1616528363530-add_cashbox_batches.js @@ -3,7 +3,7 @@ var db = require('./db') exports.up = function (next) { var sqls = [ `create table cashbox_batches ( - id serial PRIMARY KEY, + id uuid PRIMARY KEY, device_id text REFERENCES devices (device_id), created timestamptz NOT NULL default now() )`,