From 3184dcd39d8d51974b9c62dd9e41035eb0ba891c Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Thu, 26 Jan 2023 08:41:12 +0100 Subject: [PATCH] requested changes --- db/changes/230401/00-acl_notifications.sql | 6 +++--- db/changes/230401/00-alter_notSubs.sql | 14 ++++---------- db/dump/structure.sql | 3 +-- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/db/changes/230401/00-acl_notifications.sql b/db/changes/230401/00-acl_notifications.sql index 4b86e2cd0..ab40b16a5 100644 --- a/db/changes/230401/00-acl_notifications.sql +++ b/db/changes/230401/00-acl_notifications.sql @@ -1,4 +1,4 @@ INSERT INTO `salix`.`ACL` (model,property,accessType,principalId) - VALUES ('NotificationSubscription','*','*','employee'); -INSERT INTO `salix`.`ACL` (model,property,accessType,principalId) - VALUES ('NotificationAcl','*','*','employee'); + VALUES + ('NotificationSubscription','*','*','employee'), + ('NotificationAcl','*','READ','employee'); diff --git a/db/changes/230401/00-alter_notSubs.sql b/db/changes/230401/00-alter_notSubs.sql index 3ead323b0..a4177bba4 100644 --- a/db/changes/230401/00-alter_notSubs.sql +++ b/db/changes/230401/00-alter_notSubs.sql @@ -1,10 +1,4 @@ -CREATE OR REPLACE TABLE `util`.`notificationSubscription` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `notificationFk` int(11) NOT NULL, - `userFk` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - KEY `notificationSubscription_ibfk_1` (`notificationFk`), - KEY `notificationSubscription_ibfk_2` (`userFk`), - CONSTRAINT `notificationSubscription_ibfk_1` FOREIGN KEY (`notificationFk`) REFERENCES `notification` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `notificationSubscription_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE util.notificationSubscription +ADD Id int(11) auto_increment NULL, +DROP PRIMARY KEY, +ADD CONSTRAINT PRIMARY KEY (Id); diff --git a/db/dump/structure.sql b/db/dump/structure.sql index 97d7603f6..831296bc6 100644 --- a/db/dump/structure.sql +++ b/db/dump/structure.sql @@ -19726,10 +19726,9 @@ DROP TABLE IF EXISTS `notificationSubscription`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `notificationSubscription` ( - `id` int(11) NOT NULL AUTO_INCREMENT, `notificationFk` int(11) NOT NULL, `userFk` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), + PRIMARY KEY (`notificationFk`,`userFk`), KEY `notificationSubscription_ibfk_1` (`notificationFk`), KEY `notificationSubscription_ibfk_2` (`userFk`), CONSTRAINT `notificationSubscription_ibfk_1` FOREIGN KEY (`notificationFk`) REFERENCES `notification` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,