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>
41 lines
1.0 KiB
C#
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");
|
|
}
|
|
}
|
|
}
|