mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-08-23 10:52:44 +02:00
Initial open source release
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
const (
|
||||
SESSION_TABLE = "sessions"
|
||||
)
|
||||
|
||||
type Session struct {
|
||||
ID *uuid.UUID `gorm:"primary_key;not null;unique;type:uuid"`
|
||||
CreatedAt *time.Time `gorm:"not null;index"`
|
||||
UpdatedAt *time.Time `gorm:"not null;index"`
|
||||
// IP address of the user when the session was created
|
||||
IPAddress string `gorm:"not null;index;default:''"`
|
||||
// the expiresAt is the time when the session will expire, nomatter the maxAgeAt
|
||||
ExpiresAt *time.Time `gorm:"not null;index"`
|
||||
// the maxAgeAt is the time when the session will expire, nomatter the expiresAt
|
||||
MaxAgeAt *time.Time `gorm:"not null;index"`
|
||||
// has-one
|
||||
//
|
||||
// belongs to
|
||||
UserID string `gorm:";type:uuid;"`
|
||||
User *User
|
||||
}
|
||||
|
||||
func (Session) TableName() string {
|
||||
return SESSION_TABLE
|
||||
}
|
||||
Reference in New Issue
Block a user