Commit 38ccfdf6 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Changing genesis (a terrible name) to portal. Currently a new field,

but will delete the old field after testing.
parent b92523d1
......@@ -354,6 +354,7 @@ CREATE TABLE `apt_announcements` (
`created` datetime default NULL,
`uid_idx` int(10) default NULL,
`genesis` varchar(64) NOT NULL default 'emulab',
`portal` varchar(64) NOT NULL default 'emulab',
`retired` tinyint(1) NOT NULL default '0',
`max_seen` int(8) NOT NULL default '20',
`text` mediumtext,
......@@ -4182,6 +4183,7 @@ CREATE TABLE `projects` (
`nonlocal_type` tinytext,
`manager_urn` varchar(128) default NULL,
`genesis` enum('emulab','aptlab','cloudlab','phantomnet') NOT NULL default 'emulab',
`portal` enum('emulab','aptlab','cloudlab','phantomnet') default NULL,
PRIMARY KEY (`pid_idx`),
UNIQUE KEY `pid` (`pid`),
KEY `unix_gid` (`unix_gid`),
......@@ -4960,6 +4962,7 @@ CREATE TABLE `users` (
`nocollabtools` tinyint(1) default '0',
`initial_passphrase` varchar(128) default NULL,
`genesis` enum('emulab','aptlab','cloudlab','phantomnet') NOT NULL default 'emulab',
`portal` enum('emulab','aptlab','cloudlab','phantomnet') default NULL,
PRIMARY KEY (`uid_idx`),
KEY `unix_uid` (`unix_uid`),
KEY `status` (`status`),
......
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("projects", "portal")) {
DBQueryFatal("alter table projects add ".
" `portal` enum('emulab','aptlab',".
" 'cloudlab','phantomnet') default NULL ".
" after genesis");
DBQueryFatal("update projects set portal=genesis ".
"where genesis='aptlab' or genesis='cloudlab' or ".
" genesis='phantomnet'");
}
if (!DBSlotExists("users", "portal")) {
DBQueryFatal("alter table users add ".
" `portal` enum('emulab','aptlab',".
" 'cloudlab','phantomnet') default NULL ".
" after genesis");
DBQueryFatal("update users set portal=genesis ".
"where genesis='aptlab' or genesis='cloudlab' or ".
" genesis='phantomnet'");
}
if (!DBSlotExists("apt_announcements", "portal")) {
DBQueryFatal("alter table apt_announcements add ".
" `portal` varchar(64) NOT NULL default 'emulab' ".
" after genesis");
DBQueryFatal("update apt_announcements set portal=genesis");
}
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