Add account entity

This commit is contained in:
2025-11-26 09:35:56 +09:00
parent 0215abd6ec
commit 28cfe99c78
6 changed files with 488 additions and 0 deletions

View File

@ -0,0 +1,46 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Hcs.WebApp.Data.Hcs.Migrations
{
/// <inheritdoc />
public partial class AddAccountEntity : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Accounts",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
HcsId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
ThirdPartyId = table.Column<string>(type: "nvarchar(max)", nullable: true),
SyncedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
LastSyncOperationId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Accounts", x => x.Id);
table.ForeignKey(
name: "FK_Accounts_Operations_LastSyncOperationId",
column: x => x.LastSyncOperationId,
principalTable: "Operations",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_Accounts_LastSyncOperationId",
table: "Accounts",
column: "LastSyncOperationId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Accounts");
}
}
}