From 46e8f5b8110f1bf6d11d3e3dae15b8c66174f49f Mon Sep 17 00:00:00 2001 From: guillermo Date: Wed, 10 Jul 2024 07:46:18 +0200 Subject: [PATCH] feat: refs #7511 Rename to multiConfig tables --- back/methods/edi/updateData.js | 6 +++--- back/model-config.json | 2 +- back/models/user-config.json | 2 +- db/dump/fixtures.before.sql | 2 +- db/routines/pbx/views/queueConf.sql | 2 +- db/routines/vn/procedures/company_getFiscaldata.sql | 2 +- db/routines/vn/procedures/invoiceOut_new.sql | 4 ++-- db/routines/vn/procedures/item_devalueA2.sql | 2 +- db/versions/11146-maroonCordyline/00-firstScript.sql | 9 +++++++++ modules/route/back/methods/route/getExpeditionSummary.js | 2 +- myt.config.yml | 4 ++-- 11 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 db/versions/11146-maroonCordyline/00-firstScript.sql diff --git a/back/methods/edi/updateData.js b/back/methods/edi/updateData.js index 6bebad1e4..c9789d2d8 100644 --- a/back/methods/edi/updateData.js +++ b/back/methods/edi/updateData.js @@ -24,7 +24,7 @@ module.exports = Self => { try { const options = {transaction: tx, userId: ctx.req.accessToken.userId}; - const files = await Self.rawSql('SELECT name, checksum, keyValue FROM edi.fileConfig', null, options); + const files = await Self.rawSql('SELECT name, checksum, keyValue FROM edi.fileMultiConfig', null, options); const updatableFiles = []; for (const file of files) { @@ -54,7 +54,7 @@ module.exports = Self => { const tables = await Self.rawSql(` SELECT fileName, toTable, file - FROM edi.tableConfig + FROM edi.tableMultiConfig WHERE file IN (?)`, [fileNames], options); for (const table of tables) { @@ -228,7 +228,7 @@ module.exports = Self => { await Self.rawSql(sqlTemplate, [filePath], options); await Self.rawSql(` - UPDATE edi.tableConfig + UPDATE edi.tableMultiConfig SET updated = ? WHERE fileName = ? `, [Date.vnNew(), baseName], options); diff --git a/back/model-config.json b/back/model-config.json index 58fa86797..ecd6ed168 100644 --- a/back/model-config.json +++ b/back/model-config.json @@ -40,7 +40,7 @@ "ChatConfig": { "dataSource": "vn" }, - "DefaultViewConfig": { + "DefaultViewMultiConfig": { "dataSource": "vn" }, "Delivery": { diff --git a/back/models/user-config.json b/back/models/user-config.json index 5c5df1b9e..f8e563dc3 100644 --- a/back/models/user-config.json +++ b/back/models/user-config.json @@ -3,7 +3,7 @@ "base": "VnModel", "options": { "mysql": { - "table": "userConfig" + "table": "userMultiConfig" } }, "properties": { diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index 4f85db98a..85f689f55 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -1943,7 +1943,7 @@ INSERT INTO `vn`.`orderTicket`(`orderFk`, `ticketFk`) (21, 21), (22, 22); -INSERT INTO `vn`.`userConfig` (`userFk`, `warehouseFk`, `companyFk`) +INSERT INTO `vn`.`userMultiConfig` (`userFk`, `warehouseFk`, `companyFk`) VALUES (1, 1, 69), (5, 1, 442), diff --git a/db/routines/pbx/views/queueConf.sql b/db/routines/pbx/views/queueConf.sql index 07c241589..107989801 100644 --- a/db/routines/pbx/views/queueConf.sql +++ b/db/routines/pbx/views/queueConf.sql @@ -10,5 +10,5 @@ AS SELECT `q`.`name` AS `name`, `c`.`ringInUse` AS `ringinuse` FROM ( `pbx`.`queue` `q` - JOIN `pbx`.`queueConfig` `c` ON(`q`.`config` = `c`.`id`) + JOIN `pbx`.`queueMultiConfig` `c` ON(`q`.`config` = `c`.`id`) ) diff --git a/db/routines/vn/procedures/company_getFiscaldata.sql b/db/routines/vn/procedures/company_getFiscaldata.sql index 7c56382e9..b59ae38e1 100644 --- a/db/routines/vn/procedures/company_getFiscaldata.sql +++ b/db/routines/vn/procedures/company_getFiscaldata.sql @@ -7,7 +7,7 @@ DECLARE vCompanyFk INT; SELECT IFNULL(uc.companyFk, rc.defaultCompanyFk) INTO vCompanyFk FROM vn.routeConfig rc - LEFT JOIN userConfig uc ON uc.userFk = workerFk; + LEFT JOIN userMultiConfig uc ON uc.userFk = workerFk; SELECT diff --git a/db/routines/vn/procedures/invoiceOut_new.sql b/db/routines/vn/procedures/invoiceOut_new.sql index 42c3f99da..c9b94027e 100644 --- a/db/routines/vn/procedures/invoiceOut_new.sql +++ b/db/routines/vn/procedures/invoiceOut_new.sql @@ -216,7 +216,7 @@ BEGIN i.transactionTypeSageFk, @vTaxCodeGeneral := i.taxClassCodeFk FROM tmp.ticketServiceTax tst - JOIN invoiceOutTaxConfig i ON i.taxClassCodeFk = tst.code + JOIN invoiceOutTaxMultiConfig i ON i.taxClassCodeFk = tst.code WHERE i.isService HAVING taxableBase ) sub; @@ -229,7 +229,7 @@ BEGIN i.taxTypeSageFk , i.transactionTypeSageFk FROM tmp.ticketTax tt - JOIN invoiceOutTaxConfig i ON i.taxClassCodeFk = tt.code + JOIN invoiceOutTaxMultiConfig i ON i.taxClassCodeFk = tt.code WHERE !i.isService GROUP BY tt.pgcFk HAVING taxableBase diff --git a/db/routines/vn/procedures/item_devalueA2.sql b/db/routines/vn/procedures/item_devalueA2.sql index c9f716d8f..5b03fc872 100644 --- a/db/routines/vn/procedures/item_devalueA2.sql +++ b/db/routines/vn/procedures/item_devalueA2.sql @@ -42,7 +42,7 @@ BEGIN END IF; SELECT warehouseFk INTO vWarehouseFk - FROM userConfig + FROM userMultiConfig WHERE userFk = account.myUser_getId(); IF NOT vWarehouseFk OR vWarehouseFk IS NULL THEN diff --git a/db/versions/11146-maroonCordyline/00-firstScript.sql b/db/versions/11146-maroonCordyline/00-firstScript.sql new file mode 100644 index 000000000..16093311e --- /dev/null +++ b/db/versions/11146-maroonCordyline/00-firstScript.sql @@ -0,0 +1,9 @@ +RENAME TABLE hedera.shelfConfig TO hedera.shelfMultiConfig ; +RENAME TABLE pbx.queueConfig TO pbx.queueMultiConfig ; +RENAME TABLE salix.defaultViewConfig TO salix.defaultViewMultiConfig; +RENAME TABLE edi.fileConfig TO edi.fileMultiConfig; +RENAME TABLE edi.imapConfig TO edi.imapMultiConfig; +RENAME TABLE edi.tableConfig TO edi.tableMultiConfig; +RENAME TABLE vn.invoiceOutTaxConfig TO vn.invoiceOutTaxMultiConfig; +RENAME TABLE vn.userConfig TO vn.userMultiConfig; +RENAME TABLE vn.conveyorConfig TO vn.conveyorMultiConfig; diff --git a/modules/route/back/methods/route/getExpeditionSummary.js b/modules/route/back/methods/route/getExpeditionSummary.js index 2bd2ca43a..afe54b030 100644 --- a/modules/route/back/methods/route/getExpeditionSummary.js +++ b/modules/route/back/methods/route/getExpeditionSummary.js @@ -48,7 +48,7 @@ module.exports = Self => { LEFT JOIN vn.expeditionStateType est ON est.id = e.stateTypeFk JOIN vn.agencyMode am ON am.id = r.agencyModeFk JOIN vn.agency ag ON ag.id = am.agencyFk - LEFT JOIN vn.userConfig uc ON uc.userFk = account.myUser_getId() + LEFT JOIN vn.userMultiConfig uc ON uc.userFk = account.myUser_getId() WHERE t.routeFk = ? GROUP BY t.addressFk, e.itemPackingTypeFk ) sub diff --git a/myt.config.yml b/myt.config.yml index 56239ca3c..116e3668a 100755 --- a/myt.config.yml +++ b/myt.config.yml @@ -42,7 +42,7 @@ fixtures: - ACL - fieldAcl - module - - defaultViewConfig + - defaultViewMultiConfig vn: - alertLevel - bookingPlanner @@ -363,7 +363,7 @@ localFixtures: - travelConfig - travelRecalc - travelThermograph - - userConfig + - userMultiConfig - vehicle - wagonConfig - wagonType