Commit 1aad98df authored by Leigh B Stoller's avatar Leigh B Stoller

Add web_tasks and web_sessions. Works in progress.

parent 070c7706
......@@ -92,6 +92,8 @@ CREATE TABLE `apt_profiles` (
`public` tinyint(1) NOT NULL default '0',
`shared` tinyint(1) NOT NULL default '0',
`listed` tinyint(1) NOT NULL default '0',
`locked` datetime default NULL,
`status` varchar(32) default NULL,
`weburi` tinytext,
`description` mediumtext,
`rspec` mediumtext,
......@@ -5206,6 +5208,36 @@ CREATE TABLE `vlans` (
KEY `exptidx` (`exptidx`,`virtual`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `web_sessions`
--
DROP TABLE IF EXISTS `web_sessions`;
CREATE TABLE `web_sessions` (
`session_id` varchar(128) binary NOT NULL default '',
`session_expires` datetime NOT NULL default '0000-00-00 00:00:00',
`session_data` text,
PRIMARY KEY (`session_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `web_tasks`
--
DROP TABLE IF EXISTS `web_tasks`;
CREATE TABLE `web_tasks` (
`task_id` varchar(128) binary NOT NULL default '',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
`exited` datetime default NULL,
`process_id` int(11) default '0',
`object_uuid` varchar(40) NOT NULL default '',
`exitcode` tinyint(3) default '0',
`task_data` text,
PRIMARY KEY (`task_id`),
KEY `object_uuid` (`object_uuid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `webcams`
--
......
#
# Add the relocatable flag to indicate whether the lba_low field must
# be respected (0) or whether the image is "position independent" (1).
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("apt_profiles", "locked")) {
DBQueryFatal("ALTER TABLE apt_profiles ADD ".
" `locked` datetime default NULL ".
" AFTER listed");
}
if (!DBSlotExists("apt_profiles", "status")) {
DBQueryFatal("ALTER TABLE apt_profiles ADD ".
" `status` varchar(32) default NULL ".
" AFTER locked");
}
if (!DBTableExists("web_sessions")) {
DBQueryFatal("CREATE TABLE `web_sessions` ( ".
" `session_id` varchar(128) binary NOT NULL default '', ".
" `session_expires` datetime NOT NULL ".
" default '0000-00-00 00:00:00', ".
" `session_data` text, ".
" PRIMARY KEY (`session_id`) ".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
}
if (!DBTableExists("web_tasks")) {
DBQueryFatal("CREATE TABLE `web_tasks` ( ".
" `task_id` varchar(128) binary NOT NULL default '', ".
" `created` datetime NOT NULL ".
" default '0000-00-00 00:00:00', ".
" `modified` datetime NOT NULL ".
" default '0000-00-00 00:00:00', ".
" `exited` datetime default NULL, ".
" `process_id` int(11) default '0', ".
" `object_uuid` varchar(40) NOT NULL default '', ".
" `exitcode` tinyint(3) default '0', ".
" `task_data` text, ".
" PRIMARY KEY (`task_id`), ".
" KEY `object_uuid` (`object_uuid`) ".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
}
return 0;
}
# Local Variables:
# mode:perl
# End:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment