You've already forked openaccounting-server
forked from cybercinch/openaccounting-server
- 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>
13 lines
412 B
Go
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"`
|
|
}
|