diff --git a/config/dbconfig/dbconfig.go b/config/dbconfig/dbconfig.go index afa415d..a707bc9 100644 --- a/config/dbconfig/dbconfig.go +++ b/config/dbconfig/dbconfig.go @@ -52,6 +52,10 @@ func GetDb() *gorm.DB { func Init() error { db := GetDb() + + // db.Exec(`ALTER TABLE leader_boards DROP COLUMN IF EXISTS users;`) + db.Exec(`CREATE EXTENSION IF NOT EXISTS "uuid-ossp";`) + if err := db.AutoMigrate( &migrate.User{}, &migrate.Role{}, @@ -79,9 +83,6 @@ func Init() error { log.Fatal(err) } - // db.Exec(`ALTER TABLE leader_boards DROP COLUMN IF EXISTS users;`) - db.Exec(`CREATE EXTENSION IF NOT EXISTS "uuid-ossp";`) - logwrapper.Log.Info("Congrats ! Automigration completed") return nil