Fix last migration

This commit is contained in:
2025-10-28 16:05:35 +09:00
parent 53df5e1767
commit 683d600cb0
6 changed files with 15 additions and 26 deletions

View File

@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace Hcs.WebApp.Data.Hcs.Migrations
{
[DbContext(typeof(HcsDbContext))]
[Migration("20251028063057_CreateHcsSchema")]
[Migration("20251028065710_CreateHcsSchema")]
public partial class CreateHcsSchema
{
/// <inheritdoc />
@ -35,7 +35,6 @@ namespace Hcs.WebApp.Data.Hcs.Migrations
.HasColumnType("datetime2");
b.Property<string>("FailureReason")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("InitiatorId")
@ -75,7 +74,6 @@ namespace Hcs.WebApp.Data.Hcs.Migrations
.HasColumnType("datetime2");
b.Property<string>("FailureReason")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("MessageGuid")
@ -105,10 +103,9 @@ namespace Hcs.WebApp.Data.Hcs.Migrations
.HasColumnType("bit");
b.Property<string>("LastSyncError")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("LastSyncOperationId")
b.Property<int?>("LastSyncOperationId")
.HasColumnType("int");
b.Property<string>("Name")
@ -171,9 +168,7 @@ namespace Hcs.WebApp.Data.Hcs.Migrations
{
b.HasOne("Hcs.WebApp.Data.Hcs.Operation", "LastSyncOperation")
.WithMany("Registries")
.HasForeignKey("LastSyncOperationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
.HasForeignKey("LastSyncOperationId");
b.Navigation("LastSyncOperation");
});

View File

@ -21,7 +21,7 @@ namespace Hcs.WebApp.Data.Hcs.Migrations
StartedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
EndedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
Step = table.Column<int>(type: "int", nullable: false),
FailureReason = table.Column<string>(type: "nvarchar(max)", nullable: false)
FailureReason = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
@ -40,7 +40,7 @@ namespace Hcs.WebApp.Data.Hcs.Migrations
StartedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
EndedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
MessageGuid = table.Column<string>(type: "nvarchar(max)", nullable: true),
FailureReason = table.Column<string>(type: "nvarchar(max)", nullable: false)
FailureReason = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
@ -62,8 +62,8 @@ namespace Hcs.WebApp.Data.Hcs.Migrations
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
IsCommon = table.Column<bool>(type: "bit", nullable: false),
SyncedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
LastSyncOperationId = table.Column<int>(type: "int", nullable: false),
LastSyncError = table.Column<string>(type: "nvarchar(max)", nullable: false)
LastSyncOperationId = table.Column<int>(type: "int", nullable: true),
LastSyncError = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
@ -72,8 +72,7 @@ namespace Hcs.WebApp.Data.Hcs.Migrations
name: "FK_Registries_Operations_LastSyncOperationId",
column: x => x.LastSyncOperationId,
principalTable: "Operations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
principalColumn: "Id");
});
migrationBuilder.CreateTable(

View File

@ -32,7 +32,6 @@ namespace Hcs.WebApp.Data.Hcs.Migrations
.HasColumnType("datetime2");
b.Property<string>("FailureReason")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("InitiatorId")
@ -72,7 +71,6 @@ namespace Hcs.WebApp.Data.Hcs.Migrations
.HasColumnType("datetime2");
b.Property<string>("FailureReason")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("MessageGuid")
@ -102,10 +100,9 @@ namespace Hcs.WebApp.Data.Hcs.Migrations
.HasColumnType("bit");
b.Property<string>("LastSyncError")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("LastSyncOperationId")
b.Property<int?>("LastSyncOperationId")
.HasColumnType("int");
b.Property<string>("Name")
@ -168,9 +165,7 @@ namespace Hcs.WebApp.Data.Hcs.Migrations
{
b.HasOne("Hcs.WebApp.Data.Hcs.Operation", "LastSyncOperation")
.WithMany("Registries")
.HasForeignKey("LastSyncOperationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
.HasForeignKey("LastSyncOperationId");
b.Navigation("LastSyncOperation");
});