Skip to content
GitLab
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
e8aacb26
Commit
e8aacb26
authored
Sep 10, 2017
by
Leigh B Stoller
Browse files
Rename card,port in port_counters and change the primary key to iface.
Another nail in the card,port coffin.
parent
e90ee1e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
sql/database-create.sql
View file @
e8aacb26
...
...
@@ -4204,8 +4204,8 @@ CREATE TABLE `plab_slices` (
DROP
TABLE
IF
EXISTS
`port_counters`
;
CREATE
TABLE
`port_counters`
(
`node_id`
char
(
32
)
NOT
NULL
default
''
,
`card`
tinyint
(
3
)
unsigned
NOT
NULL
default
'0'
,
`port`
smallint
(
5
)
unsigned
NOT
NULL
default
'0'
,
`card
_saved
`
tinyint
(
3
)
unsigned
NOT
NULL
default
'0'
,
`port
_saved
`
smallint
(
5
)
unsigned
NOT
NULL
default
'0'
,
`iface`
text
NOT
NULL
,
`ifInOctets`
int
(
10
)
unsigned
NOT
NULL
default
'0'
,
`ifInUcastPkts`
int
(
10
)
unsigned
NOT
NULL
default
'0'
,
...
...
@@ -4219,7 +4219,7 @@ CREATE TABLE `port_counters` (
`ifOutDiscards`
int
(
10
)
unsigned
NOT
NULL
default
'0'
,
`ifOutErrors`
int
(
10
)
unsigned
NOT
NULL
default
'0'
,
`ifOutQLen`
int
(
10
)
unsigned
NOT
NULL
default
'0'
,
PRIMARY
KEY
(
`node_id`
,
`
card`
,
`port`
)
PRIMARY
KEY
(
`node_id`
,
`
iface`
(
128
)
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
--
...
...
sql/updates/4/602
0 → 100644
View file @
e8aacb26
#
# Update port_counters, no more card,port
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (DBKeyExists("port_counters", "PRIMARY")) {
DBQueryFatal("alter table port_counters drop primary key");
}
if (DBSlotExists("port_counters", "card")) {
DBQueryFatal("alter table port_counters ".
" change card card_saved ".
" tinyint(3) unsigned NOT NULL default '0',".
" change port port_saved ".
" smallint(5) unsigned NOT NULL default '0'");
}
# These get left behind.
DBQueryFatal("delete from port_counters where iface=''");
if (!DBKeyExists("port_counters", "PRIMARY")) {
DBQueryFatal("alter table port_counters add primary key ".
" (`node_id`,`iface`(128))");
}
return 0;
}
1;
# Local Variables:
# mode:perl
# End:
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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