initial commit
This commit is contained in:
commit
e8da0f7874
15 files changed
+722
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user