Commit 8d3f6875 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Database changes for repo-based profiles. Pushing these up now so that

elabinelab creation will work.
parent 87214f75
......@@ -615,7 +615,7 @@ sub RecordHistory($$)
" created,now(),$expired, ".
" extension_count,extension_days, ".
" physnode_count,virtnode_count, ".
" servername,rspec,params,manifest ".
" servername,rspec,script,paramdefs,params,manifest ".
" from apt_instances where uuid='$uuid'")
or return -1;
......
......@@ -262,6 +262,8 @@ CREATE TABLE `apt_instance_history` (
`virtnode_count` smallint(5) unsigned NOT NULL default '0',
`servername` tinytext,
`rspec` mediumtext,
`script` mediumtext,
`paramdefs` mediumtext,
`params` mediumtext,
`manifest` mediumtext,
PRIMARY KEY (`uuid`),
......@@ -316,6 +318,8 @@ CREATE TABLE `apt_instances` (
`cert` mediumtext,
`privkey` mediumtext,
`rspec` mediumtext,
`script` mediumtext,
`paramdefs` mediumtext,
`params` mediumtext,
`manifest` mediumtext,
`openstack_utilization` mediumtext,
......@@ -376,6 +380,9 @@ CREATE TABLE `apt_profile_versions` (
`parent_profileid` int(8) unsigned default NULL,
`parent_version` int(8) unsigned default NULL,
`status` varchar(32) default NULL,
`repourl` tinytext,
`reponame` varchar(40) default NULL,
`repohash` varchar(64) default NULL,
`rspec` mediumtext,
`script` mediumtext,
`paramdefs` mediumtext,
......
......@@ -1335,6 +1335,8 @@ REPLACE INTO table_regex VALUES ('apt_profiles','disabled','int','redirect','def
REPLACE INTO table_regex VALUES ('apt_profiles','description','text','redirect','default:html_fulltext',0,512,NULL);
REPLACE INTO table_regex VALUES ('apt_profiles','rspec','text','redirect','default:html_fulltext',0,262143,NULL);
REPLACE INTO table_regex VALUES ('apt_profiles','script','text','redirect','default:html_fulltext',0,65535,NULL);
REPLACE INTO table_regex VALUES ('apt_profiles','repourl','text','redirect','default:tinytext',0,0,NULL);
REPLACE INTO table_regex VALUES ('apt_profiles','repohash','text','regex','^[\\w]+$',0,64,NULL);
--
-- Dumping data for table `testsuite_preentables`
......
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("apt_profile_versions", "repourl")) {
DBQueryFatal("alter table apt_profile_versions " .
" add `repourl` tinytext after status, ".
" add `reponame` varchar(40) default NULL after repourl, ".
" add `repohash` varchar(64) default NULL after reponame");
}
DBQueryFatal("replace INTO table_regex VALUES ".
" ('apt_profiles','repourl','text','redirect', ".
" 'default:tinytext',0,0,NULL)");
DBQueryFatal("replace INTO table_regex VALUES ".
" ('apt_profiles','repohash','text','regex', ".
" '^[\\\\w]+\$',0,0,NULL)");
if (!DBSlotExists("apt_instances", "script")) {
DBQueryFatal("alter table apt_instances " .
" add `script` mediumtext after rspec, ".
" add `paramdefs` mediumtext after script");
}
if (!DBSlotExists("apt_instance_history", "script")) {
DBQueryFatal("alter table apt_instance_history " .
" add `script` mediumtext after rspec, ".
" add `paramdefs` mediumtext after script");
}
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