Commit 625a7456 authored by Leigh B Stoller's avatar Leigh B Stoller

Add flag to APT history table track expire vs terminated instances.

parent c97b3783
......@@ -481,7 +481,7 @@ sub RecordHistory($)
DBQueryWarn("replace into apt_instance_history ".
"select uuid,name,profile_id,profile_version,slice_uuid, ".
" creator,creator_idx,creator_uuid,pid,pid_idx, ".
" aggregate_urn,public_url,created,now(), ".
" aggregate_urn,public_url,created,now(),0, ".
" extension_count,extension_days, ".
" physnode_count,virtnode_count, ".
" servername,rspec,params,manifest ".
......
......@@ -163,6 +163,7 @@ CREATE TABLE `apt_instance_history` (
`public_url` tinytext,
`created` datetime default NULL,
`destroyed` datetime default NULL,
`expired` tinyint(1) NOT NULL default '0',
`extension_count` smallint(5) unsigned NOT NULL default '0',
`extension_days` smallint(5) unsigned NOT NULL default '0',
`physnode_count` smallint(5) unsigned NOT NULL default '0',
......
#
# APT Stuff.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("apt_instance_history", "expired")) {
DBQueryFatal("alter table apt_instance_history add ".
" `expired` tinyint(1) NOT NULL default '0' ".
" after destroyed");
}
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