package model
import (
"github.com/google/uuid"
"gorm.io/gorm"
)
func (u *User) BeforeCreate(tx *gorm.DB) (err error) {
newID := uuid.New().String()
u.ID = newID
return
}
func (a *Album) BeforeCreate(tx *gorm.DB) (err error) {
a.ID = newID
func (m *MediaItem) BeforeCreate(tx *gorm.DB) (err error) {
m.ID = newID
func (t *Tag) BeforeCreate(tx *gorm.DB) (err error) {
t.ID = newID
func (d *Device) BeforeCreate(tx *gorm.DB) (err error) {
d.ID = newID