Added a database upgrade that adds a tag_id,image_id index to image_tags, and lengthens the filename field to 255 characters. 64 was ridiculous.

Also added a substr to the filename for the merge code so it won't error when it's a long name
This commit is contained in:
Matthew Barbour
2019-06-24 17:14:53 -05:00
committed by Shish
parent 80e614b53e
commit dfeb3bf5df
2 changed files with 21 additions and 2 deletions

View File

@ -224,7 +224,7 @@ class ImageIO extends Extension
:hash, :ext, :width, :height, now(), :source
)",
[
"owner_id"=>$user->id, "owner_ip"=>$_SERVER['REMOTE_ADDR'], "filename"=>substr($image->filename, 0, 60), "filesize"=>$image->filesize,
"owner_id" => $user->id, "owner_ip" => $_SERVER['REMOTE_ADDR'], "filename" => substr($image->filename, 0, 255), "filesize" => $image->filesize,
"hash"=>$image->hash, "ext"=>strtolower($image->ext), "width"=>$image->width, "height"=>$image->height, "source"=>$image->source
]
);
@ -342,7 +342,7 @@ class ImageIO extends Extension
id = :id
",
[
"filename"=>$image->filename, "filesize"=>$image->filesize, "hash"=>$image->hash,
"filename" => substr($image->filename, 0, 255), "filesize"=>$image->filesize, "hash"=>$image->hash,
"ext"=>strtolower($image->ext), "width"=>$image->width, "height"=>$image->height, "source"=>$image->source,
"id"=>$id
]