Files
SVSimServer/SVSim.Database/Migrations/20260527175337_AddViewerUdid.cs
gamer147 dffd7a9746 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>
2026-05-27 13:54:15 -04:00

41 lines
1.0 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SVSim.Database.Migrations
{
/// <inheritdoc />
public partial class AddViewerUdid : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "Udid",
table: "Viewers",
type: "uuid",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Viewers_Udid",
table: "Viewers",
column: "Udid",
unique: true,
filter: "\"Udid\" IS NOT NULL");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Viewers_Udid",
table: "Viewers");
migrationBuilder.DropColumn(
name: "Udid",
table: "Viewers");
}
}
}