Commit 305d1557 authored by Leigh Stoller's avatar Leigh Stoller

Add pid,pid_idx to apt_instances and apt_instance_history. Add some keys to

experiment_stats.
parent 3d9da26d
#!/usr/bin/perl -wT
#
# Copyright (c) 2007-2014 University of Utah and the Flux Group.
# Copyright (c) 2007-2015 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -344,8 +344,8 @@ sub RecordHistory($)
DBQueryWarn("replace into apt_instance_history ".
"select uuid,profile_id,profile_version,slice_uuid, ".
" creator,creator_idx,creator_uuid,aggregate_urn, ".
" public_url,created,now(),servername, ".
" creator,creator_idx,creator_uuid,pid,pid_idx, ".
" aggregate_urn,public_url,created,now(),servername, ".
" rspec,params,manifest ".
" from apt_instances where uuid='$uuid'")
or return -1;
......
......@@ -99,6 +99,8 @@ CREATE TABLE `apt_instance_history` (
`creator` varchar(8) NOT NULL default '',
`creator_idx` mediumint(8) unsigned NOT NULL default '0',
`creator_uuid` varchar(40) NOT NULL default '',
`pid` varchar(48) default NULL,
`pid_idx` mediumint(8) unsigned default NULL,
`aggregate_urn` varchar(128) default NULL,
`public_url` tinytext,
`created` datetime default NULL,
......@@ -123,6 +125,8 @@ CREATE TABLE `apt_instances` (
`creator` varchar(8) NOT NULL default '',
`creator_idx` mediumint(8) unsigned NOT NULL default '0',
`creator_uuid` varchar(40) NOT NULL default '',
`pid` varchar(48) default NULL,
`pid_idx` mediumint(8) unsigned default NULL,
`aggregate_urn` varchar(128) default NULL,
`public_url` tinytext,
`created` datetime default NULL,
......@@ -1186,6 +1190,8 @@ CREATE TABLE `experiment_stats` (
KEY `rsrcidx` (`rsrcidx`),
KEY `pideid` (`pid`,`eid`),
KEY `eid_uuid` (`eid_uuid`)
KEY `pid_idx` (`pid_idx`),
KEY `creator_idx` (`creator_idx`),
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
......
#
# Modify APT tables
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("apt_instances", "pid")) {
DBQueryFatal("alter table apt_instances add ".
" `pid` varchar(48) default NULL after creator_uuid");
}
if (!DBSlotExists("apt_instances", "pid_idx")) {
DBQueryFatal("alter table apt_instances add ".
" `pid_idx` mediumint(8) unsigned default NULL after pid");
}
if (!DBSlotExists("apt_instance_history", "pid")) {
DBQueryFatal("alter table apt_instance_history add ".
" `pid` varchar(48) default NULL after creator_uuid");
}
if (!DBSlotExists("apt_instance_history", "pid_idx")) {
DBQueryFatal("alter table apt_instance_history add ".
" `pid_idx` mediumint(8) unsigned default NULL after pid");
}
if (!DBKeyExists("experiment_stats", "pid_idx")) {
DBQueryFatal("alter table experiment_stats add ".
" KEY `pid_idx` (`pid_idx`)");
}
if (!DBKeyExists("experiment_stats", "creator_idx")) {
DBQueryFatal("alter table experiment_stats add ".
" KEY `creator_idx` (`creator_idx`)");
}
return 0;
}
1;
# 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