From e9ad95821e295871aa90b5c4eabc384fcf7e6d9e Mon Sep 17 00:00:00 2001 From: qowevisa Date: Wed, 6 Nov 2024 19:47:12 +0200 Subject: [PATCH] Add db.Session type --- db/db.go | 1 + db/session.go | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 db/session.go diff --git a/db/db.go b/db/db.go index 43f3e9c..dfd3d08 100644 --- a/db/db.go +++ b/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 } diff --git a/db/session.go b/db/session.go new file mode 100644 index 0000000..62a70f8 --- /dev/null +++ b/db/session.go @@ -0,0 +1,10 @@ +package db + +import "time" + +type Session struct { + ID string `gorm:"primaryKey"` + UserID uint + User *User + ExpireAt time.Time +}