Skip to content

Commit

Permalink
Remove weight column
Browse files Browse the repository at this point in the history
  • Loading branch information
ArktinenKarpalo committed Mar 12, 2024
1 parent 9636d4f commit 44c927d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/db/migrations/20240309224600_weight_removal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
exports.up = async (knex) => {
await knex.raw('DROP VIEW "RVITEM"');
await knex.raw('ALTER TABLE "RVITEM_ALL" DROP COLUMN "weight"');
await knex.raw(
'CREATE VIEW "RVITEM" AS SELECT * FROM "RVITEM_ALL" WHERE deleted IS FALSE',
);
};

exports.down = async () => {};
2 changes: 1 addition & 1 deletion src/db/productStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ module.exports.updateProduct = async (barcode, productData, userId) => {
return await knex.transaction(async (trx) => {
const rvitemFields = deleteUndefinedFields({
pgrpid: productData.categoryId,
descr: productData.name
descr: productData.name,
});
if (Object.keys(rvitemFields).length > 0) {
const priceRow = await knex('PRICE')
Expand Down

0 comments on commit 44c927d

Please sign in to comment.