Archived
Template
1
0

Initial commit

This commit is contained in:
uberswe
2021-12-12 14:56:13 +01:00
commit 0511f8fbca
1627 changed files with 773292 additions and 0 deletions

9
models/session.go Normal file
View File

@ -0,0 +1,9 @@
package models
import "gorm.io/gorm"
type Session struct {
gorm.Model
Identifier string
UserID uint
}

16
models/token.go Normal file
View File

@ -0,0 +1,16 @@
package models
import "gorm.io/gorm"
type Token struct {
gorm.Model
Value string
Type string
ModelID int
ModelType string
}
const (
TokenUserActivation string = "user_activation"
TokenPasswordReset string = "password_reset"
)

16
models/user.go Normal file
View File

@ -0,0 +1,16 @@
// Package models defines all the database models for the application
package models
import (
"gorm.io/gorm"
"time"
)
type User struct {
gorm.Model
Email string
Password string
ActivatedAt *time.Time
Tokens []Token `gorm:"polymorphic:Model;"`
Sessions []Session
}

10
models/website.go Normal file
View File

@ -0,0 +1,10 @@
package models
import "gorm.io/gorm"
type Website struct {
gorm.Model
Title string
Description string
URL string
}