Migration AddConceptVotes, generated by dotnet-ef 8.0.0
The snapshot is regenerated; EF also reordered two pre-existing properties (BridgeAction.TargetSurface, one ProjectId) into its canonical order. Migration discovery now lists thirteen ids. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3c135b8e67
commit
270ab95cc7
4 changed files with 2399 additions and 10 deletions
2197
src/Bifrost.Web/Data/Migrations/20261010043937_AddConceptVotes.Designer.cs
generated
Normal file
2197
src/Bifrost.Web/Data/Migrations/20261010043937_AddConceptVotes.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,93 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bifrost.Web.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddConceptVotes : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ConceptSubjects",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Collection = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
|
||||
Key = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
|
||||
Title = table.Column<string>(type: "character varying(240)", maxLength: 240, nullable: false),
|
||||
RegisteredAtUtc = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||
RetiredAtUtc = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ConceptSubjects", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ConceptAppraisals",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
SubjectId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
VoterKey = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
|
||||
Stance = table.Column<string>(type: "character varying(16)", maxLength: 16, nullable: false),
|
||||
VoterClass = table.Column<string>(type: "character varying(16)", maxLength: 16, nullable: false),
|
||||
UserAccountId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
NetworkTag = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
|
||||
CastAtUtc = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ConceptAppraisals", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ConceptAppraisals_ConceptSubjects_SubjectId",
|
||||
column: x => x.SubjectId,
|
||||
principalTable: "ConceptSubjects",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_ConceptAppraisals_UserAccounts_UserAccountId",
|
||||
column: x => x.UserAccountId,
|
||||
principalTable: "UserAccounts",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ConceptAppraisals_NetworkTag_CastAtUtc",
|
||||
table: "ConceptAppraisals",
|
||||
columns: new[] { "NetworkTag", "CastAtUtc" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ConceptAppraisals_SubjectId_VoterKey",
|
||||
table: "ConceptAppraisals",
|
||||
columns: new[] { "SubjectId", "VoterKey" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ConceptAppraisals_UserAccountId",
|
||||
table: "ConceptAppraisals",
|
||||
column: "UserAccountId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ConceptSubjects_Collection_Key",
|
||||
table: "ConceptSubjects",
|
||||
columns: new[] { "Collection", "Key" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ConceptAppraisals");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ConceptSubjects");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -367,15 +367,15 @@ namespace Bifrost.Web.Data.Migrations
|
|||
.HasMaxLength(240)
|
||||
.HasColumnType("character varying(240)");
|
||||
|
||||
b.Property<string>("TargetSurface")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("TargetSurfaceName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(120)
|
||||
.HasColumnType("character varying(120)");
|
||||
|
||||
b.Property<string>("TargetSurface")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(240)
|
||||
|
|
@ -412,6 +412,88 @@ namespace Bifrost.Web.Data.Migrations
|
|||
b.ToTable("BridgeActions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Bifrost.Web.Domain.ConceptAppraisal", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTimeOffset>("CastAtUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("NetworkTag")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("character varying(64)");
|
||||
|
||||
b.Property<string>("Stance")
|
||||
.IsRequired()
|
||||
.HasMaxLength(16)
|
||||
.HasColumnType("character varying(16)");
|
||||
|
||||
b.Property<Guid>("SubjectId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid?>("UserAccountId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("VoterClass")
|
||||
.IsRequired()
|
||||
.HasMaxLength(16)
|
||||
.HasColumnType("character varying(16)");
|
||||
|
||||
b.Property<string>("VoterKey")
|
||||
.IsRequired()
|
||||
.HasMaxLength(120)
|
||||
.HasColumnType("character varying(120)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserAccountId");
|
||||
|
||||
b.HasIndex("NetworkTag", "CastAtUtc");
|
||||
|
||||
b.HasIndex("SubjectId", "VoterKey")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("ConceptAppraisals");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Bifrost.Web.Domain.ConceptSubject", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Collection")
|
||||
.IsRequired()
|
||||
.HasMaxLength(80)
|
||||
.HasColumnType("character varying(80)");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasMaxLength(80)
|
||||
.HasColumnType("character varying(80)");
|
||||
|
||||
b.Property<DateTimeOffset>("RegisteredAtUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTimeOffset?>("RetiredAtUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(240)
|
||||
.HasColumnType("character varying(240)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Collection", "Key")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("ConceptSubjects");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Bifrost.Web.Domain.DecayRun", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
|
@ -889,6 +971,9 @@ namespace Bifrost.Web.Data.Migrations
|
|||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid?>("ProjectId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Provider")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
|
@ -908,9 +993,6 @@ namespace Bifrost.Web.Data.Migrations
|
|||
.HasMaxLength(240)
|
||||
.HasColumnType("character varying(240)");
|
||||
|
||||
b.Property<Guid?>("ProjectId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTimeOffset>("RecordedAtUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
|
|
@ -922,12 +1004,12 @@ namespace Bifrost.Web.Data.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ProjectId");
|
||||
|
||||
b.HasIndex("Provider", "ProviderEventId")
|
||||
.IsUnique()
|
||||
.HasFilter("\"ProviderEventId\" <> ''");
|
||||
|
||||
b.HasIndex("ProjectId");
|
||||
|
||||
b.HasIndex("UserAccountId", "Kind", "IsCurrentRecurringSupport");
|
||||
|
||||
b.ToTable("PatronSupportEvents");
|
||||
|
|
@ -1615,6 +1697,22 @@ namespace Bifrost.Web.Data.Migrations
|
|||
b.Navigation("WorkItem");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Bifrost.Web.Domain.ConceptAppraisal", b =>
|
||||
{
|
||||
b.HasOne("Bifrost.Web.Domain.ConceptSubject", "Subject")
|
||||
.WithMany()
|
||||
.HasForeignKey("SubjectId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Bifrost.Web.Domain.UserAccount", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserAccountId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.Navigation("Subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Bifrost.Web.Domain.GitHubIssueLink", b =>
|
||||
{
|
||||
b.HasOne("Bifrost.Web.Domain.WorkItem", "WorkItem")
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ public sealed class MigrationDiscoveryTests
|
|||
"20260622165000_AddBifrostNativeIdentity",
|
||||
"20260622202000_AddBridgeActionTargetSurfaceName",
|
||||
"20260705190000_AddPatronSupportProjectAttribution",
|
||||
"20261010043937_AddConceptVotes",
|
||||
];
|
||||
|
||||
// Database.GetMigrations() reads assembly metadata only; no connection is opened.
|
||||
|
|
@ -49,7 +50,7 @@ public sealed class MigrationDiscoveryTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void All_twelve_migrations_are_listed_in_order()
|
||||
public void All_thirteen_migrations_are_listed_in_order()
|
||||
{
|
||||
Assert.Equal(ExpectedMigrations, Discovered());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue