Add db.Session type
This commit is contained in:
parent
c245039015
commit
e9ad95821e
1
db/db.go
1
db/db.go
|
@ -53,5 +53,6 @@ func Connect() *gorm.DB {
|
|||
gormDB.AutoMigrate(&Transfer{})
|
||||
gormDB.AutoMigrate(&User{})
|
||||
gormDB.AutoMigrate(&Type{})
|
||||
gormDB.AutoMigrate(&Session{})
|
||||
return newUDB
|
||||
}
|
||||
|
|
10
db/session.go
Normal file
10
db/session.go
Normal file
|
@ -0,0 +1,10 @@
|
|||
package db
|
||||
|
||||
import "time"
|
||||
|
||||
type Session struct {
|
||||
ID string `gorm:"primaryKey"`
|
||||
UserID uint
|
||||
User *User
|
||||
ExpireAt time.Time
|
||||
}
|
Loading…
Reference in New Issue
Block a user