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
ec168c1e
Commit
ec168c1e
authored
Sep 15, 2016
by
Leigh B Stoller
Browse files
DB changes for image aliases and architectures. This will probably
change as I get further into it.
parent
767c90c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
sql/database-create.sql
View file @
ec168c1e
...
...
@@ -2176,6 +2176,26 @@ CREATE TABLE `ifaces` (
KEY
`lanid`
(
`lanid`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
--
-- Table structure for table `image_aliases`
--
DROP
TABLE
IF
EXISTS
`image_aliases`
;
CREATE
TABLE
`image_aliases`
(
`imagename`
varchar
(
30
)
NOT
NULL
default
''
,
`imageid`
int
(
8
)
unsigned
NOT
NULL
default
'0'
,
`pid`
varchar
(
48
)
NOT
NULL
default
''
,
`pid_idx`
mediumint
(
8
)
unsigned
NOT
NULL
default
'0'
,
`gid`
varchar
(
32
)
NOT
NULL
default
''
,
`gid_idx`
mediumint
(
8
)
unsigned
NOT
NULL
default
'0'
,
`uuid`
varchar
(
40
)
NOT
NULL
default
''
,
`target_imagename`
varchar
(
30
)
NOT
NULL
default
''
,
`target_imageid`
int
(
8
)
unsigned
NOT
NULL
default
'0'
,
PRIMARY
KEY
(
`imageid`
),
UNIQUE
KEY
`pid`
(
`pid`
,
`imagename`
),
KEY
`uuid`
(
`uuid`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
--
-- Table structure for table `image_boot_status`
--
...
...
@@ -2373,6 +2393,7 @@ CREATE TABLE `image_updates` (
DROP
TABLE
IF
EXISTS
`images`
;
CREATE
TABLE
`images`
(
`imagename`
varchar
(
30
)
NOT
NULL
default
''
,
`architecture`
varchar
(
30
)
default
NULL
,
`version`
int
(
8
)
unsigned
NOT
NULL
default
'0'
,
`imageid`
int
(
8
)
unsigned
NOT
NULL
default
'0'
,
`pid`
varchar
(
48
)
NOT
NULL
default
''
,
...
...
@@ -3230,6 +3251,7 @@ DROP TABLE IF EXISTS `node_types`;
CREATE
TABLE
`node_types`
(
`class`
varchar
(
30
)
default
NULL
,
`type`
varchar
(
30
)
NOT
NULL
default
''
,
`architecture`
varchar
(
30
)
default
NULL
,
`modelnetcore_osid`
varchar
(
35
)
default
NULL
,
`modelnetedge_osid`
varchar
(
35
)
default
NULL
,
`isvirtnode`
tinyint
(
4
)
NOT
NULL
default
'0'
,
...
...
sql/updates/4/530
0 → 100644
View file @
ec168c1e
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("node_types", "architecture")) {
DBQueryFatal("alter table node_types add ".
" `architecture` varchar(30) default NULL ".
" after `type`");
}
if (!DBSlotExists("images", "architecture")) {
DBQueryFatal("alter table images add ".
" `architecture` varchar(30) default NULL ".
" after `imagename`");
}
if (!DBTableExists("image_aliases")) {
DBQueryFatal("CREATE TABLE `image_aliases` ( ".
" `imagename` varchar(30) NOT NULL default '', ".
" `imageid` int(8) unsigned NOT NULL default '0', ".
" `pid` varchar(48) NOT NULL default '', ".
" `pid_idx` mediumint(8) unsigned NOT NULL default '0', ".
" `gid` varchar(32) NOT NULL default '', ".
" `gid_idx` mediumint(8) unsigned NOT NULL default '0', ".
" `uuid` varchar(40) NOT NULL default '', ".
" `target_imagename` varchar(30) NOT NULL default '', ".
" `target_imageid` int(8) unsigned NOT NULL default '0',".
" PRIMARY KEY (`imageid`), ".
" UNIQUE KEY `pid` (`pid`,`imagename`), ".
" KEY `uuid` (`uuid`) ".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
}
# Need to fix up deleted images architecture.
# Fix up "generic" OSinfo objects; the version string should be unset.
DBQueryFatal("update os_info_versions set version='' ".
"where nextosid is not null and version!=''");
return 0;
}
# 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