2016-05-30 22:28:40 +08:00
|
|
|
--
|
|
|
|
-- This updates a 1.29.0 database to 1.29.1
|
|
|
|
--
|
|
|
|
--
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Add an Id column and make it the primary key of the Filters table
|
|
|
|
--
|
|
|
|
SET @s = (SELECT IF(
|
|
|
|
(SELECT COUNT(*)
|
|
|
|
FROM INFORMATION_SCHEMA.COLUMNS
|
|
|
|
WHERE table_name = 'Filters'
|
|
|
|
AND table_schema = DATABASE()
|
|
|
|
AND column_name = 'Id'
|
|
|
|
) > 0,
|
|
|
|
"SELECT 'Column Id exists in Filters'",
|
2016-06-15 23:35:11 +08:00
|
|
|
"ALTER TABLE `Filters` DROP PRIMARY KEY, ADD `Id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY FIRST, ADD KEY `Name` (`Name`);"
|
2016-05-30 22:28:40 +08:00
|
|
|
));
|
|
|
|
|
|
|
|
PREPARE stmt FROM @s;
|
|
|
|
EXECUTE stmt;
|
|
|
|
|