fix(backend): make track media fields and external id nullable

Artist, ExternalId, OriginalPictureName and OriginalAudioName were
non-nullable with '' sentinels, which forced the unique (Source,
ExternalId) index to rely on a filtered "<> ''" clause. Make them
truly nullable and drop the empty-string sentinels, backfilling
existing rows to NULL. Also fixes a formatting regression
(`track != null&&`) introduced alongside the nullability change.
This commit is contained in:
2026-07-17 17:53:57 +02:00
parent eeec891870
commit fa45843079
9 changed files with 877 additions and 33 deletions
@@ -120,8 +120,8 @@ namespace Musify.Application.PlayLists
ExternalId = request.VideoId,
DownloadRequested = true,
Duration = request.DurationSeconds,
OriginalPictureName = string.Empty,
OriginalAudioName = string.Empty,
OriginalPictureName = null,
OriginalAudioName = null,
SmallPictureName = trackConfiguration.Routes.PresetSmallPicture,
MediumPictureName = trackConfiguration.Routes.PresetMediumPicture,
LargePictureName = trackConfiguration.Routes.PresetLargePicture,