db: add nullable Viewer.Udid with partial unique index

Backstop for /tool/signup idempotency: signup-created viewers carry
the client's UDID (the AES key for that client's wire traffic);
admin-imported viewers stay null. Partial unique index allows the
column to coexist with pre-existing null rows.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-05-27 13:54:15 -04:00
parent 8e35501954
commit dffd7a9746
4 changed files with 3323 additions and 1 deletions

View File

@@ -2052,10 +2052,16 @@ namespace SVSim.Database.Migrations
NpgsqlPropertyBuilderExtensions.UseSequence(b.Property<long>("ShortUdid"), "ShortUdidSequence");
b.Property<Guid?>("Udid")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("ShortUdid");
b.HasIndex("Udid")
.IsUnique();
b.ToTable("Viewers");
});