initial commit

This commit is contained in:
matyushev_mo committed 2024-12-06 16:10:35 +03:00
commit e8da0f7874
15 files changed
+722

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
package main
import (
c "desq.com.ru/testjwtauth/config"
"desq.com.ru/testjwtauth/models"
"gorm.io/driver/postgres"
"gorm.io/gorm"
)
func initDB() (*gorm.DB, error) {
db, err := gorm.Open(postgres.Open(c.DSN), &gorm.Config{})
if err != nil {
return nil, err
}
db.AutoMigrate(&models.RefreshToken{})
return db, nil
}