2015-11-12 05:54:41 +08:00
|
|
|
--
|
2016-01-23 00:46:46 +08:00
|
|
|
-- This updates a 1.28.108 database to 1.28.109
|
2015-11-12 05:54:41 +08:00
|
|
|
--
|
|
|
|
|
|
|
|
--
|
|
|
|
-- 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 = 'Servers'
|
|
|
|
AND table_schema = DATABASE()
|
|
|
|
AND column_name = 'Hostname'
|
|
|
|
) > 0,
|
|
|
|
"SELECT 'Column Hostname already exists in Servers'",
|
2015-11-17 00:01:41 +08:00
|
|
|
"ALTER TABLE `Servers` ADD COLUMN `Hostname` TEXT AFTER Name"
|
2015-11-12 05:54:41 +08:00
|
|
|
));
|
|
|
|
|
|
|
|
PREPARE stmt FROM @s;
|
|
|
|
EXECUTE stmt;
|