You've already forked openaccounting-server
forked from cybercinch/openaccounting-server
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>
This commit is contained in:
10
models/token.go
Normal file
10
models/token.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package models
|
||||
|
||||
// Token represents an API token
|
||||
type Token struct {
|
||||
ID []byte `gorm:"type:BINARY(16);primaryKey"`
|
||||
Name string `gorm:"column:name;size:100"`
|
||||
UserOrgID uint `gorm:"column:userOrgId;not null"`
|
||||
|
||||
UserOrg UserOrg `gorm:"foreignKey:UserOrgID"`
|
||||
}
|
||||
Reference in New Issue
Block a user