[UUID Migration] Phase 4 - Remove integer IDs #31

Open
opened 2026-10-06 15:48:41 +02:00 by Sansan · 1 comment
Owner

Follow-up to #29. Once all clients use UUIDs, remove everything that still depends on integer IDs.

  • Drop the integer id columns (soundtrack.id, song.soundtrack_id) and their sequence, and use UUIDs as the only keys
  • Remove integer IDs from API responses (soundtrack_id in statistics, etc.) and any endpoint parameters that take them
  • Remove ResetSoundtrackIdSeq and the duplicate-key retry in insertSoundtrack
  • Remove the legacy .id file cleanup in sync (removeIDFiles)
  • Update sqlc queries, migrations (new down/up), tests and the OpenAPI spec

Depends on: #29 deployed and the frontend and Godot client switched to UUIDs.

Follow-up to #29. Once all clients use UUIDs, remove everything that still depends on integer IDs. - Drop the integer `id` columns (`soundtrack.id`, `song.soundtrack_id`) and their sequence, and use UUIDs as the only keys - Remove integer IDs from API responses (`soundtrack_id` in statistics, etc.) and any endpoint parameters that take them - Remove `ResetSoundtrackIdSeq` and the duplicate-key retry in `insertSoundtrack` - Remove the legacy `.id` file cleanup in sync (`removeIDFiles`) - Update sqlc queries, migrations (new down/up), tests and the OpenAPI spec Depends on: #29 deployed and the frontend and Godot client switched to UUIDs.
Author
Owner

Status check (2026-10-09): Phase 3 (#29) is done on develop (2c3e971), so this only waits for that to be deployed. The clients don't block it any more:

  • MusicPlayer. It never uses integer soundtrack or song IDs. soundtrack_id only appears in its generated API types (server/generated/soundtrack_with_songs.gd, song_info_for_stats.gd). After this change, run tools/generate_api_types.gd there, so the field goes away. Nothing else changes.
  • MusicFrontend. It doesn't use integer IDs.
  • PUT /music/played?song=N. N is the position in the client's play queue, not a database ID, so it stays.

What is left on the server:

  • SoundtrackID in internal/backend/statistics.go and the statistics queries;
  • ResetSoundtrackIdSeq and the duplicate-key retry in insertSoundtrack (sync.go);
  • removeIDFiles;
  • a migration dropping the integer columns.

Migration 000006 is still undeployed, so decide whether the drop goes into a new 000007 or into 000006.

Status check (2026-10-09): Phase 3 (#29) is done on `develop` (2c3e971), so this only waits for that to be deployed. The clients don't block it any more: - **MusicPlayer.** It never uses integer soundtrack or song IDs. `soundtrack_id` only appears in its generated API types (`server/generated/soundtrack_with_songs.gd`, `song_info_for_stats.gd`). After this change, run `tools/generate_api_types.gd` there, so the field goes away. Nothing else changes. - **MusicFrontend.** It doesn't use integer IDs. - **`PUT /music/played?song=N`.** N is the position in the client's play queue, not a database ID, so it stays. What is left on the server: - `SoundtrackID` in `internal/backend/statistics.go` and the statistics queries; - `ResetSoundtrackIdSeq` and the duplicate-key retry in `insertSoundtrack` (`sync.go`); - `removeIDFiles`; - a migration dropping the integer columns. Migration 000006 is still undeployed, so decide whether the drop goes into a new 000007 or into 000006.
Sansan added the maintenance label 2026-10-15 21:56:20 +02:00
Sign in to join this conversation.