export structure and fix test #416
|
@ -110,13 +110,15 @@ BEGIN
|
||||||
SELECT `name` FROM `user` WHERE id = OLD.id;
|
SELECT `name` FROM `user` WHERE id = OLD.id;
|
||||||
END$$
|
END$$
|
||||||
|
|
||||||
CREATE TRIGGER role_beforeInsert
|
DROP TRIGGER IF EXISTS account.role_beforeInsert$$
|
||||||
|
CREATE DEFINER=`root`@`%` TRIGGER role_beforeInsert
|
||||||
BEFORE INSERT ON `role` FOR EACH ROW
|
BEFORE INSERT ON `role` FOR EACH ROW
|
||||||
BEGIN
|
BEGIN
|
||||||
CALL role_checkName(NEW.`name`);
|
CALL role_checkName(NEW.`name`);
|
||||||
END$$
|
END
|
||||||
|
|
||||||
CREATE TRIGGER role_beforeUpdate
|
DROP TRIGGER IF EXISTS account.role_beforeUpdate$$
|
||||||
|
CREATE DEFINER=`root`@`%` TRIGGER role_beforeUpdate
|
||||||
BEFORE UPDATE ON `role` FOR EACH ROW
|
BEFORE UPDATE ON `role` FOR EACH ROW
|
||||||
BEGIN
|
BEGIN
|
||||||
IF !(NEW.`name` <=> OLD.`name`) THEN
|
IF !(NEW.`name` <=> OLD.`name`) THEN
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
DROP PROCEDURE IF EXISTS account.role_checkName;
|
DROP PROCEDURE IF EXISTS account.role_checkName;
|
||||||
|
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE PROCEDURE account.role_checkName(vRoleName VARCHAR(255))
|
CREATE DEFINER=`root`@`%` PROCEDURE account.role_checkName(vRoleName VARCHAR(255))
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Checks that role name meets the necessary syntax requirements, otherwise it
|
* Checks that role name meets the necessary syntax requirements, otherwise it
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2116,4 +2116,18 @@ INSERT INTO `vn`.`tabletDepartment`(`tabletFk`, `departmentFk`)
|
||||||
(1, 23),
|
(1, 23),
|
||||||
(2, 1);
|
(2, 1);
|
||||||
|
|
||||||
|
INSERT INTO `vn`.`campaign`(`code`, `dated`)
|
||||||
|
VALUES
|
||||||
|
('valentinesDay', CONCAT(YEAR(CURDATE()), '-02-14')),
|
||||||
|
('valentinesDay', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -1 YEAR)), '-02-14')),
|
||||||
|
('valentinesDay', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -2 YEAR)), '-02-14')),
|
||||||
|
('valentinesDay', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -3 YEAR)), '-02-14')),
|
||||||
|
('mothersDay', CONCAT(YEAR(CURDATE()), '-05-05')),
|
||||||
|
('mothersDay', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -1 YEAR)), '-05-05')),
|
||||||
|
('mothersDay', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -2 YEAR)), '-05-05')),
|
||||||
|
('mothersDay', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -3 YEAR)), '-05-05')),
|
||||||
|
('allSaints', CONCAT(YEAR(CURDATE()), '-11-01')),
|
||||||
|
('allSaints', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -1 YEAR)), '-11-01')),
|
||||||
|
('allSaints', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -2 YEAR)), '-11-01')),
|
||||||
|
('allSaints', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -3 YEAR)), '-11-01'));
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -82,3 +82,10 @@ TABLES=(
|
||||||
workcenter
|
workcenter
|
||||||
)
|
)
|
||||||
dump_tables ${TABLES[@]}
|
dump_tables ${TABLES[@]}
|
||||||
|
|
||||||
|
TABLES=(
|
||||||
|
sage
|
||||||
|
TiposIva
|
||||||
|
TiposTransacciones
|
||||||
|
)
|
||||||
|
dump_tables ${TABLES[@]}
|
|
@ -9,6 +9,7 @@ SCHEMAS=(
|
||||||
nst
|
nst
|
||||||
pbx
|
pbx
|
||||||
postgresql
|
postgresql
|
||||||
|
sage
|
||||||
salix
|
salix
|
||||||
stock
|
stock
|
||||||
util
|
util
|
||||||
|
|
|
@ -7,7 +7,7 @@ describe('Client activeWorkersWithRole', () => {
|
||||||
|
|
||||||
let isSalesPerson = await app.models.Account.hasRole(result[0].id, 'salesPerson');
|
let isSalesPerson = await app.models.Account.hasRole(result[0].id, 'salesPerson');
|
||||||
|
|
||||||
expect(result.length).toEqual(16);
|
expect(result.length).toEqual(17);
|
||||||
expect(isSalesPerson).toBeTruthy();
|
expect(isSalesPerson).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ describe('Client listWorkers', () => {
|
||||||
.then(result => {
|
.then(result => {
|
||||||
let amountOfEmployees = Object.keys(result).length;
|
let amountOfEmployees = Object.keys(result).length;
|
||||||
|
|
||||||
expect(amountOfEmployees).toEqual(51);
|
expect(amountOfEmployees).toEqual(53);
|
||||||
done();
|
done();
|
||||||
})
|
})
|
||||||
.catch(done.fail);
|
.catch(done.fail);
|
||||||
|
|
Loading…
Reference in New Issue