Files
openaccounting-server/models/user.go

22 lines
1.1 KiB
Go
Raw Normal View History

package models
// User represents a user account
type User struct {
ID []byte `gorm:"type:BINARY(16);primaryKey"`
Inserted uint64 `gorm:"column:inserted;not null"`
Updated uint64 `gorm:"column:updated;not null"`
FirstName string `gorm:"column:firstName;size:50;not null"`
LastName string `gorm:"column:lastName;size:50;not null"`
Email string `gorm:"column:email;size:100;not null;unique"`
PasswordHash string `gorm:"column:passwordHash;size:100;not null"`
AgreeToTerms bool `gorm:"column:agreeToTerms;not null"`
PasswordReset string `gorm:"column:passwordReset;size:32;not null"`
EmailVerified bool `gorm:"column:emailVerified;not null"`
EmailVerifyCode string `gorm:"column:emailVerifyCode;size:32;not null"`
SignupSource string `gorm:"column:signupSource;size:100;not null"`
UserOrgs []UserOrg `gorm:"foreignKey:UserID"`
Sessions []Session `gorm:"foreignKey:UserID"`
APIKeys []APIKey `gorm:"foreignKey:UserID"`
}