rough in the MontageLayouts table
This commit is contained in:
parent
663cc6df87
commit
60fb654a47
|
@ -762,6 +762,14 @@ CREATE TABLE Maps (
|
||||||
`ParentId` int(1) unsigned,
|
`ParentId` int(1) unsigned,
|
||||||
PRIMARY KEY (`Id`)
|
PRIMARY KEY (`Id`)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE TABLE MontageLayouts (
|
||||||
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
||||||
|
`Name` TEXT NOT NULL,
|
||||||
|
`Positions` JSON,
|
||||||
|
PRIMARY KEY (`Id`)
|
||||||
|
);
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Apply the initial configuration
|
-- Apply the initial configuration
|
||||||
--
|
--
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
--
|
||||||
|
-- Add UpdateDiskSpace action to Filters
|
||||||
|
--
|
||||||
|
|
||||||
|
SET @s = (SELECT IF(
|
||||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
|
||||||
|
AND table_name = 'Filters'
|
||||||
|
AND column_name = 'UpdateDiskSpace'
|
||||||
|
) > 0,
|
||||||
|
"SELECT 'Column UpdateDiskSpace already exists in Filters'",
|
||||||
|
"ALTER TABLE Filters ADD `UpdateDiskSpace` tinyint(3) unsigned NOT NULL default '0' AFTER `AutoDelete`"
|
||||||
|
));
|
||||||
|
|
||||||
|
PREPARE stmt FROM @s;
|
||||||
|
EXECUTE stmt;
|
||||||
|
--
|
||||||
|
-- Update Logs table to have some Indexes
|
||||||
|
--
|
||||||
|
SET @s = (SELECT IF(
|
||||||
|
(SELECT COUNT(*)
|
||||||
|
FROM INFORMATION_SCHEMA.STATISTICS
|
||||||
|
WHERE table_name = 'Logs'
|
||||||
|
AND table_schema = DATABASE()
|
||||||
|
AND index_name = 'Logs_TimeKey_idx'
|
||||||
|
) > 0,
|
||||||
|
"SELECT 'Logs_TimeKey_idx already exists on Logs table'",
|
||||||
|
"CREATE INDEX `Logs_TimeKey_idx` ON `Logs` (`TimeKey`)"
|
||||||
|
));
|
||||||
|
|
||||||
|
PREPARE stmt FROM @s;
|
||||||
|
EXECUTE stmt;
|
||||||
|
|
||||||
|
SET @s = (SELECT IF(
|
||||||
|
(SELECT COUNT(*)
|
||||||
|
FROM INFORMATION_SCHEMA.STATISTICS
|
||||||
|
WHERE table_name = 'Logs'
|
||||||
|
AND table_schema = DATABASE()
|
||||||
|
AND index_name = 'Logs_Level_idx'
|
||||||
|
) > 0,
|
||||||
|
"SELECT 'Logs_Level_idx already exists on Logs table'",
|
||||||
|
"CREATE INDEX `Logs_Level_idx` ON `Logs` (`Level`)"
|
||||||
|
));
|
||||||
|
|
||||||
|
PREPARE stmt FROM @s;
|
||||||
|
EXECUTE stmt;
|
||||||
|
|
||||||
|
SET @s = (SELECT IF(
|
||||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
|
||||||
|
AND table_name = 'Monitors'
|
||||||
|
AND column_name = 'OutputCodec'
|
||||||
|
) > 0,
|
||||||
|
"SELECT 'Column OutputCodec already exists in Monitors'",
|
||||||
|
"ALTER TABLE `Monitors` ADD `OutputCodec` enum('h264','mjpeg') AFTER `VideoWriter`"
|
||||||
|
));
|
||||||
|
|
||||||
|
PREPARE stmt FROM @s;
|
||||||
|
EXECUTE stmt;
|
||||||
|
|
||||||
|
SET @s = (SELECT IF(
|
||||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
|
||||||
|
AND table_name = 'Monitors'
|
||||||
|
AND column_name = 'OutputContainer'
|
||||||
|
) > 0,
|
||||||
|
"SELECT 'Column OutputContainer already exists in Monitors'",
|
||||||
|
"ALTER TABLE `Monitors` ADD `OutputContainer` enum('mp4','mkv') AFTER `OutputCodec`"
|
||||||
|
));
|
||||||
|
|
||||||
|
PREPARE stmt FROM @s;
|
||||||
|
EXECUTE stmt;
|
|
@ -0,0 +1,23 @@
|
||||||
|
--
|
||||||
|
-- This adds Manufacturers and Models
|
||||||
|
--
|
||||||
|
|
||||||
|
SET @s = (SELECT IF(
|
||||||
|
(SELECT COUNT(*)
|
||||||
|
FROM INFORMATION_SCHEMA.TABLES
|
||||||
|
WHERE table_name = 'MontageLayouts'
|
||||||
|
AND table_schema = DATABASE()
|
||||||
|
) > 0,
|
||||||
|
"SELECT 'MontageLayouts table exists'",
|
||||||
|
"
|
||||||
|
CREATE TABLE MontageLayouts (
|
||||||
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
||||||
|
`Name` TEXT NOT NULL,
|
||||||
|
`Positions` JSON,
|
||||||
|
PRIMARY KEY (`Id`)
|
||||||
|
);
|
||||||
|
"
|
||||||
|
));
|
||||||
|
|
||||||
|
PREPARE stmt FROM @s;
|
||||||
|
EXECUTE stmt;
|
Loading…
Reference in New Issue