diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index be9fe05ff..8a6bd85fd 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -2816,8 +2816,8 @@ INSERT INTO `util`.`notification` (`id`, `name`, `description`) (3, 'not-main-printer-configured', 'A printer distinct than main has been configured'), (4, 'supplier-pay-method-update', 'A supplier pay method has been updated'), (5, 'modified-entry', 'An entry has been modified'), - (6, 'book-entry-deleted', 'accounting entries deleted'); - + (6, 'book-entry-deleted', 'accounting entries deleted'), + (7, 'zone-included','An email to notify zoneCollisions'); INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`) VALUES (1, 9), @@ -2826,7 +2826,8 @@ INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`) (3, 9), (4, 1), (5, 9), - (6, 9); + (6, 9), + (7, 1); INSERT INTO `util`.`notificationQueue` (`id`, `notificationFk`, `params`, `authorFk`, `status`, `created`) VALUES @@ -2843,7 +2844,8 @@ INSERT INTO `util`.`notificationSubscription` (`notificationFk`, `userFk`) (2, 1109), (1, 9), (1, 3), - (6, 9); + (6, 9), + (7, 9); INSERT INTO `vn`.`routeConfig` (`id`, `defaultWorkCenterFk`) @@ -3062,3 +3064,6 @@ INSERT INTO `vn`.`clientSms` (`id`, `clientFk`, `smsFk`, `ticketFk`) (4, 1103, 4, 32), (13, 1101, 1, NULL), (14, 1101, 4, 27); + +UPDATE salix.ACL + SET principalId='employee' WHERE model ="Notification"; diff --git a/db/versions/10881-greenHydrangea/00-firstScript.sql b/db/versions/10881-greenHydrangea/00-firstScript.sql new file mode 100644 index 000000000..1ca77c1a0 --- /dev/null +++ b/db/versions/10881-greenHydrangea/00-firstScript.sql @@ -0,0 +1,18 @@ + +-- UPDATE salix.ACL +-- SET principalId='employee' WHERE model ="Notification"; + +-- INSERT INTO util.notification (name,description) +-- VALUES ('zone-included','An email to notify zoneCollisions'); + +-- INSERT INTO util.notificationSubscription (notificationFk,userFk) +-- SELECT +-- (SELECT id FROM util.notification WHERE name= "zone-included") AS notificationFk, +-- (SELECT account.myUser_getId() ) AS userFk; + + +-- INSERT INTO util.notificationAcl (notificationFk, roleFk) +-- SELECT +-- (SELECT id FROM util.notification WHERE name = 'zone-included') AS notificationFk, +-- (SELECT id FROM account.role WHERE name = 'system') AS roleFk; + diff --git a/db/versions/10881-greenHydrangea/01-notification.vn.sql b/db/versions/10881-greenHydrangea/01-notification.vn.sql new file mode 100644 index 000000000..d05902461 --- /dev/null +++ b/db/versions/10881-greenHydrangea/01-notification.vn.sql @@ -0,0 +1,10 @@ +INSERT INTO util.notification (id, name,description) + VALUES ( +(SELECT MAX(id)+1 from util.notification n) , 'zone-included','An email to notify zoneCollisions'); + +INSERT INTO util.notificationSubscription (notificationFk,userFk) + SELECT id, account.myUser_getId() FROM util.notification WHERE name= "zone-included"; + + +INSERT INTO util.notificationAcl (notificationFk,roleFk) + SELECT id, (SELECT id from `account`.`role` where name = "system") FROM util.notification WHERE name= "zone-included"; diff --git a/db/versions/10881-greenHydrangea/01-notification.vnx.sql b/db/versions/10881-greenHydrangea/01-notification.vnx.sql new file mode 100644 index 000000000..83e2be1d0 --- /dev/null +++ b/db/versions/10881-greenHydrangea/01-notification.vnx.sql @@ -0,0 +1,10 @@ +-- INSERT INTO util.notification (id, name,description) +-- VALUES ( +-- (SELECT MAX(id)+1 from util.notification n) , 'zone-included','An email to notify zoneCollisions'); + +-- INSERT INTO util.notificationSubscription (notificationFk,userFk) +-- SELECT id, account.myUser_getId() FROM util.notification WHERE name= "zone-included"; + + +-- INSERT INTO util.notificationAcl (notificationFk,roleFk) +-- SELECT id, (SELECT id from `account`.`role` where name = "system") FROM util.notification WHERE name= "zone-included";