Commit 697f6662 authored by Leigh Stoller's avatar Leigh Stoller

More tweaks to image alias database tables.

parent bb8b7421
......@@ -2190,7 +2190,7 @@ CREATE TABLE `image_aliases` (
`uuid` varchar(40) NOT NULL default '',
`target_imagename` varchar(30) NOT NULL default '',
`target_imageid` int(8) unsigned NOT NULL default '0',
PRIMARY KEY (`imageid`),
PRIMARY KEY (`imageid`,`target_imageid`),
UNIQUE KEY `pid` (`pid`,`imagename`),
KEY `uuid` (`uuid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
......
......@@ -1099,9 +1099,11 @@ REPLACE INTO table_regex VALUES ('images','relocatable','text','redirect','defau
REPLACE INTO table_regex VALUES ('images','origin_uuid','text','regex','^\\w+\\-\\w+\\-\\w+\\-\\w+\\-\\w+$',0,64,NULL);
REPLACE INTO table_regex VALUES ('images','origin_name','text','regex','^[-\\w\\.+:\\/]+$',0,128,NULL);
REPLACE INTO table_regex VALUES ('images','origin_urn','text','redirect','projects:manager_urn',0,0,NULL);
REPLACE INTO table_regex VALUES ('images','architecture','text','regex','^[\\w,]*$',0,0,NULL);
REPLACE INTO table_regex VALUES ('node_types','new_type','text','redirect','default:tinytext',0,0,NULL);
REPLACE INTO table_regex VALUES ('node_types','node_type','text','regex','^[-\\w]+$',1,30,NULL);
REPLACE INTO table_regex VALUES ('node_types','class','text','regex','^[\\w]+$',1,30,NULL);
REPLACE INTO table_regex VALUES ('node_types','architecture','text','regex','^[\\w,]*$',0,0,NULL);
REPLACE INTO table_regex VALUES ('node_types','isvirtnode','text','redirect','default:boolean',0,0,NULL);
REPLACE INTO table_regex VALUES ('node_types','isjailed','text','redirect','default:boolean',0,0,NULL);
REPLACE INTO table_regex VALUES ('node_types','isswitch','text','redirect','default:boolean',0,0,NULL);
......
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
#
# No one is using this table yet.
#
DBQueryFatal("ALTER TABLE image_aliases DROP PRIMARY KEY");
DBQueryFatal("ALTER TABLE image_aliases ADD PRIMARY KEY ".
"(`imageid`,`target_imageid`)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('images','architecture', ".
" 'text','regex','^[\\\\w,]*\$',0,0,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('node_types','architecture', ".
" 'text','regex','^[\\\\w,]*\$',0,0,NULL)");
# Fix up special OSids; clear the version string so that it
# passes IsGeneric().
my @OSIDs = ("BLOCKSTORE-VM", "GENERICDEV");
foreach my $osname (@OSIDs) {
DBQueryFatal("update os_info_versions set version='' ".
"where pid='emulab-ops' and osname='$osname'");
}
return 0;
}
# 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