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
8180fca7
Commit
8180fca7
authored
May 14, 2012
by
Leigh B Stoller
Browse files
Add "hash" to the images table to store a sha1 of the file.
parent
1c4ec177
Changes
3
Hide whitespace changes
Inline
Side-by-side
sql/database-create.sql
View file @
8180fca7
...
@@ -1746,6 +1746,7 @@ CREATE TABLE `images` (
...
@@ -1746,6 +1746,7 @@ CREATE TABLE `images` (
`auth_uuid`
varchar
(
64
)
default
NULL
,
`auth_uuid`
varchar
(
64
)
default
NULL
,
`auth_key`
varchar
(
512
)
default
NULL
,
`auth_key`
varchar
(
512
)
default
NULL
,
`decryption_key`
varchar
(
256
)
default
NULL
,
`decryption_key`
varchar
(
256
)
default
NULL
,
`hash`
varchar
(
64
)
default
NULL
,
PRIMARY
KEY
(
`imageid`
),
PRIMARY
KEY
(
`imageid`
),
UNIQUE
KEY
`pid`
(
`pid`
,
`imagename`
),
UNIQUE
KEY
`pid`
(
`pid`
,
`imagename`
),
KEY
`gid`
(
`gid`
),
KEY
`gid`
(
`gid`
),
...
...
sql/database-fill.sql
View file @
8180fca7
...
@@ -1052,7 +1052,7 @@ REPLACE INTO table_regex VALUES ('images','mbr_version','text','redirect','defau
...
@@ -1052,7 +1052,7 @@ REPLACE INTO table_regex VALUES ('images','mbr_version','text','redirect','defau
REPLACE
INTO
table_regex
VALUES
(
'images'
,
'max_concurrent'
,
'text'
,
'redirect'
,
'default:int'
,
0
,
0
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'images'
,
'max_concurrent'
,
'text'
,
'redirect'
,
'default:int'
,
0
,
0
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'images'
,
'reboot_waittime'
,
'text'
,
'redirect'
,
'default:int'
,
0
,
0
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'images'
,
'reboot_waittime'
,
'text'
,
'redirect'
,
'default:int'
,
0
,
0
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'images'
,
'format'
,
'text'
,
'regex'
,
'^[-
\\
w]+$'
,
1
,
8
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'images'
,
'format'
,
'text'
,
'regex'
,
'^[-
\\
w]+$'
,
1
,
8
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'images'
,
'hash'
,
'text'
,
'regex'
,
'^[
\\
w]+$'
,
16
,
64
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'node_types'
,
'new_type'
,
'text'
,
'redirect'
,
'default:tinytext'
,
0
,
0
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'node_types'
,
'new_type'
,
'text'
,
'redirect'
,
'default:tinytext'
,
0
,
0
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'node_types'
,
'node_type'
,
'text'
,
'regex'
,
'^[-
\\
w]+$'
,
1
,
30
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'node_types'
,
'node_type'
,
'text'
,
'regex'
,
'^[-
\\
w]+$'
,
1
,
30
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'node_types'
,
'class'
,
'text'
,
'regex'
,
'^[
\\
w]+$'
,
1
,
30
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'node_types'
,
'class'
,
'text'
,
'regex'
,
'^[
\\
w]+$'
,
1
,
30
,
NULL
);
...
...
sql/updates/4/290
0 → 100644
View file @
8180fca7
#
# Add hash to images table.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (! DBSlotExists("images", "hash")) {
DBQueryFatal("alter table images add ".
" `hash` varchar(64) default NULL");
}
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('images','hash','text','regex','^[\\\\w]+\$',16,64,NULL)");
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