Add UserId to MontageLayouts

pull/3524/head
Isaac Connor 2022-07-12 17:33:34 -04:00
parent fa2a02c27f
commit a617a70620
2 changed files with 36 additions and 0 deletions

18
db/zm_update-1.36.20.sql Normal file
View File

@ -0,0 +1,18 @@
--
-- Update MontageLayout table to have UserId
--
SELECT 'Checking for UserId in MontageLayouts';
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'MontageLayouts'
AND table_schema = DATABASE()
AND column_name = 'UserId'
) > 0,
"SELECT 'Column UserId already exists in MontageLayouts'",
"ALTER TABLE `MontageLayouts` ADD COLUMN `UserId` int(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `Name`"
));
PREPARE stmt FROM @s;
EXECUTE stmt;

18
db/zm_update-1.37.18.sql Normal file
View File

@ -0,0 +1,18 @@
--
-- Update MontageLayout table to have UserId
--
SELECT 'Checking for UserId in MontageLayouts';
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'MontageLayouts'
AND table_schema = DATABASE()
AND column_name = 'UserId'
) > 0,
"SELECT 'Column UserId already exists in MontageLayouts'",
"ALTER TABLE `MontageLayouts` ADD COLUMN `UserId` int(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `Name`"
));
PREPARE stmt FROM @s;
EXECUTE stmt;