Files
openaccounting-server/models/user_org.go
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

13 lines
412 B
Go

package models
// UserOrg represents the relationship between users and organizations
type UserOrg struct {
ID uint `gorm:"primaryKey;autoIncrement"`
UserID []byte `gorm:"column:userId;type:BINARY(16);not null"`
OrgID []byte `gorm:"column:orgId;type:BINARY(16);not null"`
Admin bool `gorm:"column:admin;default:false"`
User User `gorm:"foreignKey:UserID"`
Org Org `gorm:"foreignKey:OrgID"`
}