Add orientation to Events

This commit is contained in:
Isaac Connor 2017-07-11 14:31:41 -04:00
parent cb98e3faea
commit 786dcb0dc1
1 changed files with 15 additions and 0 deletions

View File

@ -60,3 +60,18 @@ UPDATE Monitors SET StorageId = 0 WHERE StorageId IS NULL;
ALTER TABLE Monitors MODIFY `StorageId` smallint(5) unsigned NOT NULL default 0; ALTER TABLE Monitors MODIFY `StorageId` smallint(5) unsigned NOT NULL default 0;
UPDATE Events SET StorageId = 0 WHERE StorageId IS NULL; UPDATE Events SET StorageId = 0 WHERE StorageId IS NULL;
ALTER TABLE Events MODIFY `StorageId` smallint(5) unsigned NOT NULL default 0; ALTER TABLE Events MODIFY `StorageId` smallint(5) unsigned NOT NULL default 0;
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'Events'
AND table_schema = DATABASE()
AND column_name = 'Orientation'
) > 0,
"SELECT 'Column Orientation exists in Events'",
"ALTER TABLE `Events` ADD `Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0' AFTER `Notes`"
));
PREPARE stmt FROM @s;
EXECUTE stmt;
~