2018-01-23 03:06:03 +08:00
|
|
|
SET @s = (SELECT IF(
|
|
|
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
|
|
|
|
AND table_name = 'Groups'
|
|
|
|
AND column_name = 'MonitorIds'
|
|
|
|
) > 0,
|
2020-11-24 08:33:53 +08:00
|
|
|
"ALTER TABLE `Groups` MODIFY `MonitorIds` text NOT NULL",
|
2018-01-23 03:06:03 +08:00
|
|
|
"SELECT 'Groups no longer has MonitorIds'"
|
|
|
|
));
|
|
|
|
|
|
|
|
PREPARE stmt FROM @s;
|
|
|
|
EXECUTE stmt;
|
|
|
|
|