pull request changes required
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2022-03-28 13:35:36 +02:00
parent 39694b31b8
commit f4d53c4040
6 changed files with 15 additions and 23 deletions

View File

@ -1,2 +1,2 @@
INSERT INTO salix.ACL (id, model, property, accessType, permission, principalType, principalId) INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
VALUES(304, 'Agency', '*', '*', 'ALLOW', 'ROLE', 'employee'); VALUES(304, 'Agency', '*', '*', 'ALLOW', 'ROLE', 'employee');

View File

@ -1,3 +1,3 @@
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId) INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
VALUES VALUES
('SupplierAgencyTerm', '*', '*', 'ALLOW', 'ROLE', 'administrative'); ('SupplierAgencyTerm', '*', '*', 'ALLOW', 'ROLE', 'administrative');

View File

@ -1,14 +1,14 @@
ALTER TABLE vn.agencyTerm ADD supplierFk INT NULL; ALTER TABLE `vn`.`agencyTerm` ADD `supplierFk` INT NULL;
ALTER TABLE vn.agencyTerm CHANGE supplierFk supplierFk INT NULL AFTER agencyFk; ALTER TABLE `vn`.`agencyTerm` CHANGE `supplierFk` `supplierFk` INT NULL AFTER `agencyFk`;
UPDATE vn.agencyTerm `at` UPDATE `vn`.`agencyTerm` `at`
JOIN vn.agency a ON a.id = `at`.agencyFk JOIN `vn`.`agency` `a` ON `a`.`id` = `at`.`agencyFk`
SET `at`.supplierFk = a.supplierFk; SET `at`.`supplierFk` = `a`.`supplierFk`;
ALTER TABLE vn.agencyTerm ADD CONSTRAINT agencyTerm_FK FOREIGN KEY (agencyFk) REFERENCES vn.agency(id) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `vn`.`agencyTerm` ADD CONSTRAINT `agencyTerm_FK` FOREIGN KEY (`agencyFk`) REFERENCES `vn`.`agency`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
ALTER TABLE vn.agencyTerm ADD CONSTRAINT agencyTerm_FK_1 FOREIGN KEY (supplierFk) REFERENCES vn.supplier(id) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `vn`.`agencyTerm` ADD CONSTRAINT `agencyTerm_FK_1` FOREIGN KEY (`supplierFk`) REFERENCES `vn`.`supplier`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
RENAME TABLE vn.agencyTerm TO vn.supplierAgencyTerm; RENAME TABLE `vn`.`agencyTerm` TO `vn`.`supplierAgencyTerm`;
CREATE OR REPLACE CREATE OR REPLACE
ALGORITHM = UNDEFINED ALGORITHM = UNDEFINED
@ -26,8 +26,8 @@ SELECT
FROM FROM
`vn`.`supplierAgencyTerm` `sat`; `vn`.`supplierAgencyTerm` `sat`;
ALTER TABLE vn.agency DROP FOREIGN KEY agency_ibfk_4; ALTER TABLE `vn`.`agency` DROP FOREIGN KEY `agency_ibfk_4`;
ALTER TABLE vn.agency CHANGE supplierFk supplierFk__ int(11) DEFAULT NULL NULL; ALTER TABLE `vn`.`agency` CHANGE `supplierFk` `supplierFk__` int(11) DEFAULT NULL NULL;
CREATE OR REPLACE CREATE OR REPLACE
ALGORITHM = UNDEFINED ALGORITHM = UNDEFINED

View File

@ -1,4 +1,4 @@
let UserError = require('vn-loopback/util/user-error'); const UserError = require('vn-loopback/util/user-error');
module.exports = Self => { module.exports = Self => {
Self.rewriteDbError(function(err) { Self.rewriteDbError(function(err) {

View File

@ -42,13 +42,5 @@
"model": "Agency", "model": "Agency",
"foreignKey": "agencyFk" "foreignKey": "agencyFk"
} }
}, }
"acls": [
{
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
]
} }

View File

@ -94,7 +94,7 @@
"abstract": true "abstract": true
}, },
{ {
"url": "/index?q", "url": "/index",
"state": "supplier.card.agencyTerm.index", "state": "supplier.card.agencyTerm.index",
"component": "vn-supplier-agency-term-index", "component": "vn-supplier-agency-term-index",
"description": "Autonomous", "description": "Autonomous",