Skip to content

Commit

Permalink
chore: Update database connection, setup UUID extension, and auto-mig…
Browse files Browse the repository at this point in the history
…rate User model
  • Loading branch information
Ahmedhossamdev committed Jul 26, 2024
1 parent 13f35b0 commit 18ecf5c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions db/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ func InitDB() {

// uuid-ossp

err = DBConn.Exec("CREATE EXTERNSTION IF NOT EXISTS \"uuid-ossp\"").Error
err = DBConn.Exec("CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\"").Error

if err != nil {
fmt.Println("Can't install uuid extension")
panic(err)
}

err = DBConn.AutoMigrate()

err = DBConn.AutoMigrate(&User{})

if err != nil {
panic (err)
Expand Down

0 comments on commit 18ecf5c

Please sign in to comment.