Updated to include Indexes for Events, Logs, and Videos tables
parent
6c7ef92a38
commit
80db711d4a
12
libs/sql.js
12
libs/sql.js
|
@ -135,6 +135,18 @@ module.exports = function(s,config){
|
|||
s.sqlQuery("CREATE TABLE IF NOT EXISTS `Timelapse Frames` (`ke` varchar(50) NOT NULL,`mid` varchar(50) NOT NULL,`details` longtext,`filename` varchar(50) NOT NULL,`time` timestamp NULL DEFAULT NULL,`size` int(11) NOT NULL)" + mySQLtail + ';',[],function(err){
|
||||
if(err)console.error(err)
|
||||
},true)
|
||||
//Add index to Videos table
|
||||
s.sqlQuery('CREATE INDEX Videos_time ON Videos(time);',[],function(err){
|
||||
if(err)console.error(err)
|
||||
},true)
|
||||
//Add index to Events table
|
||||
s.sqlQuery('CREATE INDEX Events_multi ON Events(ke, mid, time);',[],function(err){
|
||||
if(err)console.error(err)
|
||||
},true)
|
||||
//Add index to Logs table
|
||||
s.sqlQuery('CREATE INDEX Logs_multi ON Events(ke, mid, time);',[],function(err){
|
||||
if(err)console.error(err)
|
||||
},true)
|
||||
//add Cloud Videos table, will remove in future
|
||||
s.sqlQuery('CREATE TABLE IF NOT EXISTS `Cloud Videos` (`mid` varchar(50) NOT NULL,`ke` varchar(50) DEFAULT NULL,`href` text NOT NULL,`size` float DEFAULT NULL,`time` timestamp NULL DEFAULT NULL,`end` timestamp NULL DEFAULT NULL,`status` int(1) DEFAULT \'0\',`details` text)' + mySQLtail + ';',[],function(err){
|
||||
if(err)console.error(err)
|
||||
|
|
Loading…
Reference in New Issue