add Orientation to Events table

This commit is contained in:
Isaac Connor 2016-10-12 09:11:50 -04:00
parent b00588b6ff
commit 1862611b94
2 changed files with 19 additions and 0 deletions

View File

@ -205,6 +205,7 @@ CREATE TABLE `Events` (
`Messaged` tinyint(3) unsigned NOT NULL default '0',
`Executed` tinyint(3) unsigned NOT NULL default '0',
`Notes` text,
`Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0',
PRIMARY KEY (`Id`,`MonitorId`),
KEY `MonitorId` (`MonitorId`),
KEY `StartTime` (`StartTime`),
@ -396,6 +397,7 @@ CREATE TABLE `Monitors` (
`WebColour` varchar(32) NOT NULL default 'red',
`Exif` tinyint(1) unsigned NOT NULL default '0',
`Sequence` smallint(5) unsigned default NULL,
`Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0',
PRIMARY KEY (`Id`)
) ENGINE=@ZM_MYSQL_ENGINE@;

17
db/zm_update-1.30.8.sql Normal file
View File

@ -0,0 +1,17 @@
--
-- This updates a 1.30.7 database to 1.30.8
--
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;