Rename column Id OF Monitor_Statuses to simplify JOINS.
This commit is contained in:
parent
2d9f9125aa
commit
456f29fcba
|
@ -644,11 +644,11 @@ CREATE INDEX `Monitors_ServerId_idx` ON `Monitors` (`ServerId`);
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `Monitor_Status`;
|
DROP TABLE IF EXISTS `Monitor_Status`;
|
||||||
CREATE TABLE `Monitor_Status` (
|
CREATE TABLE `Monitor_Status` (
|
||||||
`Id` int(10) unsigned NOT NULL,
|
`MonitorId` int(10) unsigned NOT NULL,
|
||||||
`Status` enum('Unknown','NotRunning','Running','NoSignal','Signal') NOT NULL default 'Unknown',
|
`Status` enum('Unknown','NotRunning','Running','NoSignal','Signal') NOT NULL default 'Unknown',
|
||||||
`CaptureFPS` DECIMAL(10,2) NOT NULL default 0,
|
`CaptureFPS` DECIMAL(10,2) NOT NULL default 0,
|
||||||
`AnalysisFPS` DECIMAL(5,2) NOT NULL default 0,
|
`AnalysisFPS` DECIMAL(5,2) NOT NULL default 0,
|
||||||
PRIMARY KEY (`Id`)
|
PRIMARY KEY (`MonitorId`)
|
||||||
) ENGINE=MEMORY;
|
) ENGINE=MEMORY;
|
||||||
--
|
--
|
||||||
-- Table structure for table `States`
|
-- Table structure for table `States`
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
DROP TABLE IF EXISTS `Monitor_Status`;
|
||||||
|
CREATE TABLE `Monitor_Status` (
|
||||||
|
`MonitorId` int(10) unsigned NOT NULL,
|
||||||
|
`Status` enum('Unknown','NotRunning','Running','NoSignal','Signal') NOT NULL default 'Unknown',
|
||||||
|
`CaptureFPS` DECIMAL(10,2) NOT NULL default 0,
|
||||||
|
`AnalysisFPS` DECIMAL(5,2) NOT NULL default 0,
|
||||||
|
PRIMARY KEY (`MonitorId`)
|
||||||
|
) ENGINE=MEMORY;
|
|
@ -1 +1 @@
|
||||||
Subproject commit ca91b87fda8e006e4fca2ed870f24f9a29c2905d
|
Subproject commit 7108489f218c54d36d235d3af91d6da2f8311237
|
|
@ -89,7 +89,7 @@ if ( ! is_array( $selected_monitor_ids ) ) {
|
||||||
$values += $ids;
|
$values += $ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT *,S.Status AS Status, S.CaptureFPS AS CaptureFPS FROM Monitors AS M LEFT JOIN Monitor_Status AS S ON S.Id=M.Id ' . ( count($conditions) ? ' WHERE ' . implode(' AND ', $conditions ) : '' ).' ORDER BY Sequence ASC';
|
$sql = 'SELECT *,S.Status AS Status, S.CaptureFPS AS CaptureFPS FROM Monitors AS M LEFT JOIN Monitor_Status AS S ON MonitorId=Id ' . ( count($conditions) ? ' WHERE ' . implode(' AND ', $conditions ) : '' ).' ORDER BY Sequence ASC';
|
||||||
$monitors = dbFetchAll( $sql, null, $values );
|
$monitors = dbFetchAll( $sql, null, $values );
|
||||||
$displayMonitors = array();
|
$displayMonitors = array();
|
||||||
$monitors_dropdown = array();
|
$monitors_dropdown = array();
|
||||||
|
|
Loading…
Reference in New Issue