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
|
||||
|
||||
@@ -71,13 +71,13 @@ func (s *EmailService) SendVerificationEmail(user *models.User, token *string) e
|
||||
LastName string
|
||||
Token string
|
||||
BASEURL string
|
||||
ID uint
|
||||
UserID uint
|
||||
}{
|
||||
FirstName: user.FirstName,
|
||||
LastName: user.LastName,
|
||||
Token: *token,
|
||||
BASEURL: config.Site.BaseURL,
|
||||
ID: user.ID,
|
||||
UserID: user.ID,
|
||||
}
|
||||
|
||||
subject := constants.MailVerificationSubject
|
||||
|
||||
Reference in New Issue
Block a user