Skip to content

Commit

Permalink
"Removed Debug() call from AutoMigrate and fixed quotes in CREATE EXT…
Browse files Browse the repository at this point in the history
…ENSION IF NOT EXISTS query"
  • Loading branch information
p-shubh committed Oct 6, 2024
1 parent 9af8959 commit 3135f26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db/db.connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func Init() {

InitMigration(DB)

err = DB.Debug().AutoMigrate(&models.User{}, &models.Brand{}, &models.Collection{}, &models.Phygital{}, &models.WebXR{}, &models.Avatar{}, &models.Variant{} , &models.FanToken{} , &models.ChainType{} , &models.NftEntries{} , &models.Profile{} , &models.CartItem{}, &models.OTPStore{} , &models.OTPData{}, &models.MainnetFanToken{}, &models.DelegateMintFanTokenRequest{})
err = DB.AutoMigrate(&models.User{}, &models.Brand{}, &models.Collection{}, &models.Phygital{}, &models.WebXR{}, &models.Avatar{}, &models.Variant{}, &models.FanToken{}, &models.ChainType{}, &models.NftEntries{}, &models.Profile{}, &models.CartItem{}, &models.OTPStore{}, &models.OTPData{}, &models.MainnetFanToken{}, &models.DelegateMintFanTokenRequest{})
if err != nil {
log.Fatalf("failed to migrate database: %v", err)
}
Expand All @@ -50,5 +50,5 @@ func Connect() *gorm.DB {
return DB
}
func InitMigration(db *gorm.DB) error {
return db.Exec("CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\"").Error
return db.Exec(`CREATE EXTENSION IF NOT EXISTS "uuid-ossp"`).Error
}

0 comments on commit 3135f26

Please sign in to comment.