Storage: store uploaded files in SQL rather than on the disk (#49034)

* #48259: set up storages per org id

* #48259: migrate to storage_sql
This commit is contained in:
Artur Wierzbicki
2022-05-21 16:55:11 -07:00
committed by GitHub
parent 313d203a87
commit 03fe1435a0
7 changed files with 220 additions and 45 deletions
+27
View File
@@ -0,0 +1,27 @@
package store
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func TestGetDbStoragePathPrefix(t *testing.T) {
tests := []struct {
orgId int64
storageName string
expected string
}{
{
orgId: 124,
storageName: "long-storage-name",
expected: "/124/long-storage-name/",
},
}
for _, tt := range tests {
t.Run(fmt.Sprintf("orgId: %d, storageName: %s", tt.orgId, tt.storageName), func(t *testing.T) {
assert.Equal(t, tt.expected, getDbStoragePathPrefix(tt.orgId, tt.storageName))
})
}
}