Compare commits

...

4 Commits

Author SHA1 Message Date
David Domenech e7db97a671 Merge pull request 'refactor(renameTable): refs #6125 clientCreditLimit to roleCreditLimit' (!1890) from 6125-roleCreditLimitFix into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #1890
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2023-12-13 11:46:39 +00:00
David Domenech 9bcd0a3c98 Merge branch 'dev' into 6125-roleCreditLimitFix
gitea/salix/pipeline/head This commit looks good Details
2023-12-13 11:29:46 +00:00
Pablo Natek f63b26b71f Merge branch 'dev' into 6125-roleCreditLimitFix
gitea/salix/pipeline/head There was a failure building this commit Details
2023-12-13 07:52:36 +00:00
Pablo Natek 69dd34665f refactor(renameTable): refs #6125 clientCreditLimit to roleCreditLimit
gitea/salix/pipeline/head This commit looks good Details
2023-12-13 08:50:17 +01:00
5 changed files with 9 additions and 5 deletions

View File

@ -0,0 +1,4 @@
RENAME TABLE `vn`.`clientCreditLimit` TO `vn`.`roleCreditLimit`;
ALTER TABLE `vn`.`clientCreditLimit` DROP FOREIGN KEY `clientCreditLimit_FK`;
ALTER TABLE `vn`.`roleCreditLimit` ADD CONSTRAINT `roleCreditLimit_FK` FOREIGN KEY (`roleFk`) REFERENCES `account`.`role`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@ -493,7 +493,7 @@ INSERT INTO `vn`.`clientCredit`(`clientFk`, `workerFk`, `amount`, `created`)
(1104, 9, 90 , util.VN_CURDATE()),
(1105, 9, 90 , util.VN_CURDATE());
INSERT INTO `vn`.`clientCreditLimit`(`id`, `maxAmount`, `roleFk`)
INSERT INTO `vn`.`roleCreditLimit`(`id`, `maxAmount`, `roleFk`)
VALUES
(1, 9999999, 20),
(2, 10000, 21),

View File

@ -29,7 +29,7 @@
"ClientCredit": {
"dataSource": "vn"
},
"ClientCreditLimit": {
"RoleCreditLimit": {
"dataSource": "vn"
},
"ClientConsumptionQueue": {

View File

@ -463,7 +463,7 @@ module.exports = Self => {
throw new UserError(`You can't change the credit set to zero from a financialBoss`);
}
const creditLimits = await models.ClientCreditLimit.find({
const creditLimits = await models.RoleCreditLimit.find({
fields: ['roleFk'],
where: {
maxAmount: {gte: changes.credit}

View File

@ -1,9 +1,9 @@
{
"name": "ClientCreditLimit",
"name": "RoleCreditLimit",
"base": "VnModel",
"options": {
"mysql": {
"table": "clientCreditLimit"
"table": "roleCreditLimit"
}
},
"properties": {