From 4994a836c7119a6c894e3600a78ba71438ecb410 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Sat, 9 Mar 2024 11:27:29 +0100 Subject: [PATCH] refs #5858 feat: alter table util.notification --- .../10881-greenHydrangea/00-alterTableNotification.sql | 1 + db/versions/10881-greenHydrangea/01-notification.vn.sql | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 db/versions/10881-greenHydrangea/00-alterTableNotification.sql diff --git a/db/versions/10881-greenHydrangea/00-alterTableNotification.sql b/db/versions/10881-greenHydrangea/00-alterTableNotification.sql new file mode 100644 index 000000000..068d77839 --- /dev/null +++ b/db/versions/10881-greenHydrangea/00-alterTableNotification.sql @@ -0,0 +1 @@ +ALTER TABLE util.notification MODIFY COLUMN id int(11) auto_increment NOT NULL; diff --git a/db/versions/10881-greenHydrangea/01-notification.vn.sql b/db/versions/10881-greenHydrangea/01-notification.vn.sql index 1d6620c29..6c9152ec7 100644 --- a/db/versions/10881-greenHydrangea/01-notification.vn.sql +++ b/db/versions/10881-greenHydrangea/01-notification.vn.sql @@ -1,8 +1,7 @@ -SET @MaxId = (SELECT MAX(id)+1 from util.notification n); -INSERT IGNORE INTO util.notification (`id`, `name`,`description`) +INSERT IGNORE INTO util.notification ( `name`,`description`) VALUES -(@MaxId, 'zone-included','An email to notify zoneCollisions'); - +( 'zone-included','An email to notify zoneCollisions'); +SET @MaxId = LAST_INSERT_ID(); INSERT IGNORE INTO util.notificationSubscription (notificationFk,userFk) VALUES( @MaxId, (SELECT id from `account`.`user` where name = "system"));