fix: BossRoom soft delete → hard delete + 프로필 자동 생성
All checks were successful
Server CI/CD / lint-and-build (push) Successful in 17s
Server CI/CD / deploy (push) Successful in 57s

- BossRoom 삭제 시 Unscoped() hard delete로 변경하여 unique index 충돌 방지
- GetProfile에서 프로필 없으면 기본값으로 자동 생성

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-17 13:09:23 +09:00
parent 2c1e9698d2
commit 82adb37ecb
2 changed files with 8 additions and 3 deletions

View File

@@ -208,8 +208,9 @@ func (r *Repository) ResetRoomSlot(sessionName string) error {
// DeleteRoomBySessionName removes BossRoom records for a given session name.
// Used during ResetRoom to prevent duplicate session_name conflicts on next entry.
// Unscoped to perform hard delete — soft delete would leave the unique index occupied.
func (r *Repository) DeleteRoomBySessionName(sessionName string) error {
return r.db.Where("session_name = ?", sessionName).Delete(&BossRoom{}).Error
return r.db.Unscoped().Where("session_name = ?", sessionName).Delete(&BossRoom{}).Error
}
// ResetStaleSlots clears instanceID for slots with stale heartbeats