Add db update script for 1.28.107. Fixes #663

This commit is contained in:
Kyle Johnson 2015-09-29 14:38:41 -06:00
parent 679a663861
commit 291dfe0f70
1 changed files with 21 additions and 0 deletions

21
db/zm_update-1.28.107.sql Normal file
View File

@ -0,0 +1,21 @@
--
-- This updates a 1.28.106 database to 1.28.107
--
--
-- Update Frame table to have a PrimaryKey of ID, insetad of a Composite Primary Key
-- Used primarially for compatibility with CakePHP
--
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'Frames'
AND table_schema = DATABASE()
AND column_name = 'Id'
) > 0,
"SELECT 'Column ID already exists in Monitors'",
"ALTER TABLE `Frames` ADD COLUMN `Id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT FIRST, DROP PRIMARY KEY, ADD PRIMARY KEY(`Id`)"
));
PREPARE stmt FROM @s;
EXECUTE stmt;