Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
be9e910d
Commit
be9e910d
authored
Mar 22, 2017
by
Gary Wong
Browse files
Add a database table for address pool history.
parent
200935c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
sql/database-create.sql
View file @
be9e910d
...
...
@@ -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`
--
...
...
sql/updates/4/571
0 → 100644
View file @
be9e910d
#
# 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:
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment