Storage: Content root storage (#54929)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
Artur Wierzbicki
2022-09-13 00:34:46 +02:00
committed by GitHub
parent 89d94eeab2
commit e19f36649f
12 changed files with 538 additions and 64 deletions

View File

@@ -31,17 +31,18 @@ func getDbStoragePathPrefix(orgId int64, storageName string) string {
return filestorage.Join(fmt.Sprintf("%d", orgId), storageName+filestorage.Delimiter)
}
func newSQLStorage(meta RootStorageMeta, prefix string, name string, descr string, cfg *StorageSQLConfig, sql db.DB, orgId int64) *rootStorageSQL {
func newSQLStorage(meta RootStorageMeta, prefix string, name string, descr string, cfg *StorageSQLConfig, sql db.DB, orgId int64, underContentRoot bool) *rootStorageSQL {
if cfg == nil {
cfg = &StorageSQLConfig{}
}
meta.Config = RootStorageConfig{
Type: rootStorageTypeSQL,
Prefix: prefix,
Name: name,
Description: descr,
SQL: cfg,
Type: rootStorageTypeSQL,
Prefix: prefix,
Name: name,
Description: descr,
UnderContentRoot: underContentRoot,
SQL: cfg,
}
if prefix == "" {