Commit be9e910d authored by Gary Wong's avatar Gary Wong

Add a database table for address pool history.

parent 200935c3
......@@ -54,6 +54,28 @@ CREATE TABLE `active_checkups` (
PRIMARY KEY (`object`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `addr_pool_history`
--
DROP TABLE IF EXISTS `addr_pool_history`;
CREATE TABLE `addr_pool_history` (
`history_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`pool_id` varchar(32) NOT NULL DEFAULT '',
`op` enum('alloc','free') NOT NULL DEFAULT 'alloc',
`uid` varchar(8) NOT NULL DEFAULT '',
`uid_idx` mediumint(8) unsigned NOT NULL DEFAULT '0',
`exptidx` int(10) unsigned DEFAULT NULL,
`stamp` int(10) unsigned DEFAULT NULL,
`addr` varchar(15) DEFAULT NULL,
`version` enum('ipv4','ipv6') NOT NULL DEFAULT 'ipv4',
PRIMARY KEY (`history_id`),
KEY `exptidx` (`exptidx`),
KEY `stamp` (`stamp`),
KEY `addr` (`addr`),
KEY `addrstamp` (`addr`,`stamp`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `apt_aggregate_nodetypes`
--
......
#
# Add addr_pool_history table
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBTableExists("addr_pool_history")) {
DBQueryFatal( "CREATE TABLE `addr_pool_history` ( " .
" `history_id` int(10) unsigned NOT NULL auto_increment, " .
" `pool_id` varchar(32) NOT NULL default '', " .
" `op` enum('alloc','free') NOT NULL default 'alloc', " .
" `uid` varchar(8) NOT NULL default '', " .
" `uid_idx` mediumint(8) unsigned NOT NULL default '0', " .
" `exptidx` int(10) unsigned default NULL, " .
" `stamp` int(10) unsigned default NULL, " .
" `addr` varchar(15) default NULL, " .
" `version` enum('ipv4','ipv6') NOT NULL default 'ipv4', " .
" PRIMARY KEY (`history_id`), " .
" KEY `exptidx` (`exptidx`), " .
" KEY `stamp` (`stamp`), " .
" KEY `addr` (`addr`), " .
" KEY `addrstamp` (`addr`,`stamp`) " .
") ENGINE=MyISAM DEFAULT CHARSET=latin1" );
}
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