- Add MinIO S3-compatible storage to docker-compose (dev, staging, prod) - Create migrations 103-108 (waveform_url, user_folders, user_files, user_storage_quotas, gear_items.is_public, gear_images) - Add Go models: UserFile, UserFolder, StorageQuota, GearImage - Add WaveformURL to Track model, IsPublic + GearImages to GearItem model
15 lines
436 B
Go
15 lines
436 B
Go
package models
|
|
|
|
import "github.com/google/uuid"
|
|
|
|
type StorageQuota struct {
|
|
UserID uuid.UUID `gorm:"type:uuid;primaryKey" json:"user_id"`
|
|
MaxBytes int64 `gorm:"not null;default:5368709120" json:"max_bytes"`
|
|
UsedBytes int64 `gorm:"not null;default:0" json:"used_bytes"`
|
|
|
|
User User `gorm:"foreignKey:UserID;constraint:OnDelete:CASCADE" json:"-"`
|
|
}
|
|
|
|
func (StorageQuota) TableName() string {
|
|
return "user_storage_quotas"
|
|
}
|