2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 06:47:20 +08:00

fix: sqlite dsn error

This commit is contained in:
2025-07-07 03:04:20 +08:00
parent ed5c74c753
commit c20bfdc3ea

View File

@@ -17,7 +17,7 @@ import (
func NewDB(conf *koanf.Koanf, log *slog.Logger) (*gorm.DB, error) {
// You can use any other database, like MySQL or PostgreSQL.
return gorm.Open(gormlite.Open(filepath.Join(app.Root, "panel/storage/app.db?_txlock=immediate")), &gorm.Config{
return gorm.Open(gormlite.Open("file:"+filepath.Join(app.Root, "panel/storage/app.db?_txlock=immediate")), &gorm.Config{
Logger: sloggorm.New(sloggorm.WithHandler(log.Handler())),
SkipDefaultTransaction: true,
DisableForeignKeyConstraintWhenMigrating: true,