Commit 7898f8ca authored by Jonathon Duerig's avatar Jonathon Duerig

Remove auto_incrementing idx altogether. Better to just use exptidx, pool_id...

Remove auto_incrementing idx altogether. Better to just use exptidx, pool_id as a composite primary key. Bah.
parent e22e1a51
......@@ -5109,7 +5109,6 @@ CREATE TABLE `virt_node_public_addr` (
DROP TABLE IF EXISTS `virt_address_allocation`;
CREATE TABLE `virt_address_allocation` (
`idx` int(11) NOT NULL auto_increment,
`pool_id` varchar(32) NOT NULL default '',
`pid` varchar(48) NOT NULL default '',
`eid` varchar(32) NOT NULL default '',
......@@ -5117,7 +5116,7 @@ CREATE TABLE `virt_address_allocation` (
`count` int(10) NOT NULL default '0',
`restriction` enum('contiguous','cidr','any') NOT NULL default 'any',
`version` enum('ipv4','ipv6') NOT NULL default 'ipv4',
PRIMARY KEY (`idx`)
PRIMARY KEY (`exptidx`,`pool_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
......
#
# Dataset stuff
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (DBSlotExists("virt_address_allocation", "idx")) {
DBQueryFatal("alter table virt_address_allocation drop `idx`, add primary key(`exptidx`, `pool_id`)");
}
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