Files
Aaron Guise bd3f101fb4 feat: add GORM integration with repository pattern
- Add GORM models in models/ directory with proper column tags
- Create repository interfaces and implementations in core/repository/
- Add database package with MySQL and SQLite support
- Add UUID ID utility for GORM models
- Implement complete repository layer replacing SQL-based data access
- Add database migrations and index creation
- Support both MySQL and SQLite drivers with auto-migration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-30 22:07:51 +12:00

22 lines
1.1 KiB
Go

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"`
}