fixes in prod
This commit is contained in:
@@ -50,8 +50,8 @@ func Open(dbPath string, adminMail string, debug bool) (*gorm.DB, error) {
|
||||
sqlDB.SetMaxIdleConns(1)
|
||||
sqlDB.SetConnMaxLifetime(time.Hour)
|
||||
|
||||
db.Exec("PRAGMA foreign_keys = OFF;")
|
||||
if err := db.AutoMigrate(
|
||||
&models.User{},
|
||||
&models.Subscription{},
|
||||
&models.Membership{},
|
||||
&models.Consent{},
|
||||
@@ -62,11 +62,12 @@ func Open(dbPath string, adminMail string, debug bool) (*gorm.DB, error) {
|
||||
&models.Car{},
|
||||
&models.Location{},
|
||||
&models.Damage{},
|
||||
&models.Insurance{},
|
||||
// &models.Insurance{},
|
||||
// &models.User{},
|
||||
); err != nil {
|
||||
return nil, fmt.Errorf("failed to migrate database: %w", err)
|
||||
}
|
||||
|
||||
db.Exec("PRAGMA foreign_keys = ON;")
|
||||
logger.Info.Print("Opened DB")
|
||||
DB = db
|
||||
var categoriesCount int64
|
||||
|
||||
Reference in New Issue
Block a user