mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Add filesystem based blob storage (#3187)
* Refactor transaction hooks. Add preCommit * Add BlobStore * Use blobStore for tag images * Use blobStore for studio images * Use blobStore for performer images * Use blobStore for scene covers * Don't generate screenshots in legacy directory * Run post-hooks outside original transaction * Use blobStore for movie images * Remove unnecessary DestroyImage methods * Add missing filter for scene cover * Add covers to generate options * Add generate cover option to UI * Add screenshot migration * Delete thumb files as part of screenshot migration
This commit is contained in:
19
pkg/sqlite/migrations/45_blobs.up.sql
Normal file
19
pkg/sqlite/migrations/45_blobs.up.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
CREATE TABLE `blobs` (
|
||||
`checksum` varchar(255) NOT NULL PRIMARY KEY,
|
||||
`blob` blob
|
||||
);
|
||||
|
||||
ALTER TABLE `tags` ADD COLUMN `image_blob` varchar(255) REFERENCES `blobs`(`checksum`);
|
||||
ALTER TABLE `studios` ADD COLUMN `image_blob` varchar(255) REFERENCES `blobs`(`checksum`);
|
||||
ALTER TABLE `performers` ADD COLUMN `image_blob` varchar(255) REFERENCES `blobs`(`checksum`);
|
||||
ALTER TABLE `scenes` ADD COLUMN `cover_blob` varchar(255) REFERENCES `blobs`(`checksum`);
|
||||
|
||||
ALTER TABLE `movies` ADD COLUMN `front_image_blob` varchar(255) REFERENCES `blobs`(`checksum`);
|
||||
ALTER TABLE `movies` ADD COLUMN `back_image_blob` varchar(255) REFERENCES `blobs`(`checksum`);
|
||||
|
||||
-- performed in the post-migration
|
||||
-- DROP TABLE `tags_image`;
|
||||
-- DROP TABLE `studios_image`;
|
||||
-- DROP TABLE `performers_image`;
|
||||
-- DROP TABLE `scenes_cover`;
|
||||
-- DROP TABLE `movies_images`;
|
||||
Reference in New Issue
Block a user