2017-10-10 21:36:56 +08:00
|
|
|
--
|
|
|
|
-- Add StorageId column to Monitors
|
|
|
|
--
|
|
|
|
|
|
|
|
SET @s = (SELECT IF(
|
|
|
|
(SELECT COUNT(*)
|
|
|
|
FROM INFORMATION_SCHEMA.COLUMNS
|
|
|
|
WHERE table_name = 'Events'
|
|
|
|
AND table_schema = DATABASE()
|
|
|
|
AND column_name = 'DiskSpace'
|
|
|
|
) > 0,
|
|
|
|
"SELECT 'Column DiskSpace exists in Events'",
|
2017-10-12 02:07:01 +08:00
|
|
|
"ALTER TABLE Events ADD `DiskSpace` bigint unsigned default null AFTER `Orientation`"
|
2017-10-10 21:36:56 +08:00
|
|
|
));
|
|
|
|
|
|
|
|
PREPARE stmt FROM @s;
|
|
|
|
EXECUTE stmt;
|