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
305d1557
Commit
305d1557
authored
Jan 13, 2015
by
Leigh B Stoller
Browse files
Add pid,pid_idx to apt_instances and apt_instance_history. Add some keys to
experiment_stats.
parent
3d9da26d
Changes
3
Hide whitespace changes
Inline
Side-by-side
apt/APT_Instance.pm.in
View file @
305d1557
#
!/usr/bin/perl -wT
#
#
Copyright
(
c
)
2007
-
201
4
University
of
Utah
and
the
Flux
Group
.
#
Copyright
(
c
)
2007
-
201
5
University
of
Utah
and
the
Flux
Group
.
#
#
{{{
EMULAB
-
LICENSE
#
...
...
@@ -344,8 +344,8 @@ sub RecordHistory($)
DBQueryWarn
(
"replace into apt_instance_history "
.
"select uuid,profile_id,profile_version,slice_uuid, "
.
" creator,creator_idx,creator_uuid,
aggregate_urn
, "
.
" public_url,created,now(),servername, "
.
" creator,creator_idx,creator_uuid,
pid,pid_idx
, "
.
"
aggregate_urn,
public_url,created,now(),servername, "
.
" rspec,params,manifest "
.
" from apt_instances where uuid='$uuid'"
)
or
return
-
1
;
...
...
sql/database-create.sql
View file @
305d1557
...
...
@@ -99,6 +99,8 @@ CREATE TABLE `apt_instance_history` (
`creator`
varchar
(
8
)
NOT
NULL
default
''
,
`creator_idx`
mediumint
(
8
)
unsigned
NOT
NULL
default
'0'
,
`creator_uuid`
varchar
(
40
)
NOT
NULL
default
''
,
`pid`
varchar
(
48
)
default
NULL
,
`pid_idx`
mediumint
(
8
)
unsigned
default
NULL
,
`aggregate_urn`
varchar
(
128
)
default
NULL
,
`public_url`
tinytext
,
`created`
datetime
default
NULL
,
...
...
@@ -123,6 +125,8 @@ CREATE TABLE `apt_instances` (
`creator`
varchar
(
8
)
NOT
NULL
default
''
,
`creator_idx`
mediumint
(
8
)
unsigned
NOT
NULL
default
'0'
,
`creator_uuid`
varchar
(
40
)
NOT
NULL
default
''
,
`pid`
varchar
(
48
)
default
NULL
,
`pid_idx`
mediumint
(
8
)
unsigned
default
NULL
,
`aggregate_urn`
varchar
(
128
)
default
NULL
,
`public_url`
tinytext
,
`created`
datetime
default
NULL
,
...
...
@@ -1186,6 +1190,8 @@ CREATE TABLE `experiment_stats` (
KEY
`rsrcidx`
(
`rsrcidx`
),
KEY
`pideid`
(
`pid`
,
`eid`
),
KEY
`eid_uuid`
(
`eid_uuid`
)
KEY
`pid_idx`
(
`pid_idx`
),
KEY
`creator_idx`
(
`creator_idx`
),
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
--
...
...
sql/updates/4/421
0 → 100644
View file @
305d1557
#
# Modify APT tables
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("apt_instances", "pid")) {
DBQueryFatal("alter table apt_instances add ".
" `pid` varchar(48) default NULL after creator_uuid");
}
if (!DBSlotExists("apt_instances", "pid_idx")) {
DBQueryFatal("alter table apt_instances add ".
" `pid_idx` mediumint(8) unsigned default NULL after pid");
}
if (!DBSlotExists("apt_instance_history", "pid")) {
DBQueryFatal("alter table apt_instance_history add ".
" `pid` varchar(48) default NULL after creator_uuid");
}
if (!DBSlotExists("apt_instance_history", "pid_idx")) {
DBQueryFatal("alter table apt_instance_history add ".
" `pid_idx` mediumint(8) unsigned default NULL after pid");
}
if (!DBKeyExists("experiment_stats", "pid_idx")) {
DBQueryFatal("alter table experiment_stats add ".
" KEY `pid_idx` (`pid_idx`)");
}
if (!DBKeyExists("experiment_stats", "creator_idx")) {
DBQueryFatal("alter table experiment_stats add ".
" KEY `creator_idx` (`creator_idx`)");
}
return 0;
}
1;
# Local Variables:
# mode:perl
# End:
Write
Preview
Supports
Markdown
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