fix: out of order when database is not sqlite3 (#6560)
This commit is contained in:
@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/alist-org/alist/v3/internal/conf"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func columnName(name string) string {
|
||||
@ -12,3 +13,7 @@ func columnName(name string) string {
|
||||
}
|
||||
return fmt.Sprintf("`%s`", name)
|
||||
}
|
||||
|
||||
func addStorageOrder(db *gorm.DB) *gorm.DB {
|
||||
return db.Order(fmt.Sprintf("%s, %s", columnName("order"), columnName("id")))
|
||||
}
|
||||
|
Reference in New Issue
Block a user