Commit 1782fc9b authored by Leigh B Stoller's avatar Leigh B Stoller

Add deltasize and deltahash so that each version can have both kinds

of image files present.

Add uploader_path to communicate the path to use to write the file.
Set in create_image.
parent 05963f2d
......@@ -2049,7 +2049,9 @@ CREATE TABLE `image_versions` (
`auth_key` varchar(512) default NULL,
`decryption_key` varchar(256) default NULL,
`hash` varchar(64) default NULL,
`deltahash` varchar(64) default NULL,
`size` bigint(20) unsigned NOT NULL default '0',
`deltasize` bigint(20) unsigned NOT NULL default '0',
`lba_low` bigint(20) unsigned NOT NULL default '0',
`lba_high` bigint(20) unsigned NOT NULL default '0',
`lba_size` int(10) unsigned NOT NULL default '512',
......@@ -2065,6 +2067,7 @@ CREATE TABLE `image_versions` (
`isdataset` tinyint(1) NOT NULL default '0',
`released` tinyint(1) NOT NULL default '0',
`nodetypes` text default NULL,
`uploader_path` tinytext,
`notes` mediumtext,
PRIMARY KEY (`imageid`,`version`),
KEY `pid` (`pid`,`imagename`,`version`),
......
#
# Add slots to allow the existence of both full and delta image files
# for an image version.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("image_versions", "deltahash")) {
DBQueryFatal("ALTER TABLE image_versions ADD ".
" `deltahash` varchar(64) default NULL ".
" AFTER hash");
}
if (!DBSlotExists("image_versions", "deltasize")) {
DBQueryFatal("ALTER TABLE image_versions ADD ".
" `deltasize` bigint unsigned NOT NULL default '0' ".
" AFTER size");
}
if (!DBSlotExists("image_versions", "uploader_path")) {
DBQueryFatal("ALTER TABLE image_versions ADD ".
" `uploader_path` tinytext ".
" AFTER nodetypes");
}
return 0;
}
# Local Variables:
# mode:perl
# End:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment