Improve Sheet model

This commit is contained in:
2026-01-23 21:37:18 +01:00
parent 18188ac353
commit 4540c0d880
9 changed files with 90 additions and 14 deletions

View File

@@ -3,19 +3,20 @@ package models
import (
"time"
"github.com/google/uuid"
"gorm.io/gorm"
)
type MusicSheet struct {
ID uint `json:"id" gorm:"primaryKey"`
type Sheet struct {
Uuid uuid.UUID `json:"uuid" gorm:"primaryKey"`
Title string `json:"title" gorm:"not null"`
Composer string `json:"composer"`
Description string `json:"description"`
FilePath string `json:"file_path" gorm:"not null"`
FileSize int64 `json:"file_size"`
UserID uint `json:"user_id"`
FileHash uint64 `json:"file_hash"`
User User `json:"user" gorm:"foreignKey:UserID"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
}
}