mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-07 16:16:37 +08:00
refactor(storage): drop per-upload storage_driver, use storage_config as single source
Remove w_uploads.storage_driver and route all read/write/delete paths through storage.Active() backed by storage_config.driver. Block direct driver switches when uploads exist; require migration task instead. Simplify migration to cursor-based file_path iteration without per-row driver updates.
This commit is contained in:
@@ -67,7 +67,6 @@ func TestServeFileByIDAccessControl(t *testing.T) {
|
||||
FileSize: 5,
|
||||
MimeType: "image/png",
|
||||
Extension: "png",
|
||||
StorageDriver: "local",
|
||||
Type: "avatar",
|
||||
Status: model.UploadStatusUsed,
|
||||
AccessMode: 1,
|
||||
@@ -80,7 +79,6 @@ func TestServeFileByIDAccessControl(t *testing.T) {
|
||||
FileSize: 5,
|
||||
MimeType: "application/pdf",
|
||||
Extension: "pdf",
|
||||
StorageDriver: "local",
|
||||
Type: "attachment",
|
||||
Status: model.UploadStatusUsed,
|
||||
AccessMode: 1,
|
||||
@@ -207,7 +205,6 @@ func TestImageCompression(t *testing.T) {
|
||||
FileSize: int64(pngBuf.Len()),
|
||||
MimeType: "image/png",
|
||||
Extension: "png",
|
||||
StorageDriver: "local",
|
||||
Type: "avatar", // Whitelisted by default
|
||||
Status: model.UploadStatusUsed,
|
||||
AccessMode: 1,
|
||||
|
||||
Reference in New Issue
Block a user