body text not null,
modwhen datetime not null,
size_in_bytes integer not null,
+ filekey varchar(80) not null default '',
index by_owner_category(owner_type, owner_id, category)
);
$opts{owner_id} = $owner->id;
$opts{category} ||= '';
$opts{filename} = $saved_name;
+ unless ($opts{filekey}) {
+ my $fh = IO::File->new("$file_dir/$saved_name", "r");
+ if ($fh) {
+ require Digest::MD5;
+ my $md5 = Digest::MD5->new;
+ $md5->addfile($fh);
+
+ $opts{filekey} = $md5->hexdigest;
+ }
+ }
require BSE::TB::OwnedFiles;
my $result = BSE::TB::OwnedFiles->make(%opts);
use Carp qw(confess);
sub columns {
- return qw/id owner_type owner_id category filename display_name content_type download title body modwhen size_in_bytes/;
+ return qw/id owner_type owner_id category filename display_name content_type download title body modwhen size_in_bytes filekey/;
}
sub table {
<:wrap admin/xbase.tmpl title=>"Background tasks", showtitle => 1 :>
<:ifMessage:><p><:message:></p><:or:><:eif:>
+<p>| <a href="/cgi-bin/admin/menu.pl">Admin Menu</a> |</p>
<table class="editform" id="backtasklist">
<tr>
<th>Task</th>
Column body;text;NO;NULL;
Column modwhen;datetime;NO;NULL;
Column size_in_bytes;int(11);NO;NULL;
+Column filekey;varchar(80);NO;;
Index PRIMARY;1;[id]
Index by_owner_category;0;[owner_type;owner_id;category]
Table bse_product_option_values