add Id to Filters
This commit is contained in:
parent
046acbc05b
commit
4a90980fbe
|
@ -116,3 +116,21 @@ ALTER TABLE Logs MODIFY Message TEXT NOT NULL;
|
||||||
|
|
||||||
ALTER TABLE Config MODIFY DefaultValue TEXT;
|
ALTER TABLE Config MODIFY DefaultValue TEXT;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- 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'",
|
||||||
|
"ALTER TABLE `Filters` DROP PRIMARY KEY, ADD `Id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY FIRST, ADD KEY `Name` (`Name`);"
|
||||||
|
));
|
||||||
|
|
||||||
|
PREPARE stmt FROM @s;
|
||||||
|
EXECUTE stmt;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue