fix: update associations

This commit is contained in:
2025-03-09 20:10:33 +07:00
parent d149aebf12
commit 7c7c8e6cc5
6 changed files with 124 additions and 19 deletions

View File

@@ -2,13 +2,14 @@ package database
import (
"app/internal/dal"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"gorm.io/gorm/logger"
"log"
"os"
"sync"
"time"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"gorm.io/gorm/logger"
)
var (
@@ -31,7 +32,8 @@ func initialize() error {
},
)
db, err = gorm.Open(sqlite.Open("file:"+Path+"?_fk=1"), &gorm.Config{
Logger: newLogger,
Logger: newLogger,
FullSaveAssociations: false,
})
if err != nil {
return err