update models to use uuid referencing
Some checks failed
Release and Deploy / build (push) Failing after 6m58s
Release and Deploy / deploy (push) Has been skipped

This commit is contained in:
2026-03-01 16:46:06 +01:00
parent 35c53cc54c
commit cf7473b373
4 changed files with 49 additions and 229 deletions

View File

@@ -92,7 +92,6 @@ func (r *LeaderboardRepository) FullReplace(ctx context.Context, serverID uuid.U
// Re-insert children with correct leaderboard ID
for i := range lb.Drivers {
lb.Drivers[i].LeaderboardID = existing.ID
lb.Drivers[i].ID = uuid.Nil // force new ID
}
if len(lb.Drivers) > 0 {
if err := tx.Create(&lb.Drivers).Error; err != nil {
@@ -112,7 +111,6 @@ func (r *LeaderboardRepository) FullReplace(ctx context.Context, serverID uuid.U
for i := range lb.Races {
lb.Races[i].LeaderboardID = existing.ID
lb.Races[i].ID = uuid.Nil
}
if len(lb.Races) > 0 {
// Create races first (without results) to get IDs