Commit 90ad919a authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Tweaks to recently added slots for repo-based profiles:

1. We do not need to save the param definitions; we have the script.

2. We do want to save the refspec in the history, even though we have
   the hash. Easier to see what is going on.
parent 19c8a501
......@@ -615,8 +615,8 @@ sub RecordHistory($$)
" created,now(),$expired, ".
" extension_count,extension_days, ".
" physnode_count,virtnode_count, ".
" servername,repourl,reponame,repohash, ".
" rspec,script,paramdefs,params,manifest ".
" servername,repourl,reponame,reporef,repohash, ".
" rspec,script,params,manifest ".
" from apt_instances where uuid='$uuid'")
or return -1;
......
......@@ -263,10 +263,10 @@ CREATE TABLE `apt_instance_history` (
`servername` tinytext,
`repourl` tinytext,
`reponame` varchar(40) default NULL,
`reporef` varchar(128) default NULL,
`repohash` varchar(64) default NULL,
`rspec` mediumtext,
`script` mediumtext,
`paramdefs` mediumtext,
`params` mediumtext,
`manifest` mediumtext,
PRIMARY KEY (`uuid`),
......@@ -326,7 +326,6 @@ CREATE TABLE `apt_instances` (
`repohash` varchar(64) default NULL,
`rspec` mediumtext,
`script` mediumtext,
`paramdefs` mediumtext,
`params` mediumtext,
`manifest` mediumtext,
`openstack_utilization` mediumtext,
......
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("apt_instances", "reporef")) {
DBQueryFatal("alter table apt_instances " .
" add `reporef` varchar(128) default NULL after reponame");
}
if (!DBSlotExists("apt_instance_history", "reporef")) {
DBQueryFatal("alter table apt_instance_history " .
" add `reporef` varchar(128) default NULL after reponame");
}
if (DBSlotExists("apt_instances", "paramdefs")) {
DBQueryFatal("alter table apt_instances drop paramdefs");
}
if (DBSlotExists("apt_instance_history", "paramdefs")) {
DBQueryFatal("alter table apt_instance_history drop paramdefs");
}
return 0;
}
# Local Variables:
# mode:perl
# End:
Supports Markdown
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