Files
Backend-Api/AccountMangement.Infrastructure.EFCore/Migrations/20240722150241_AccountLeftworkTable.cs

62 lines
1.9 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AccountMangement.Infrastructure.EFCore.Migrations
{
/// <inheritdoc />
public partial class AccountLeftworkTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AccountLeftWork",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
StartWorkGr = table.Column<DateTime>(type: "datetime2", nullable: false),
LeftWorkGr = table.Column<DateTime>(type: "datetime2", nullable: false),
AccountId = table.Column<long>(type: "bigint", nullable: false),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AccountLeftWork", x => x.id);
table.ForeignKey(
name: "FK_AccountLeftWork_Accounts_AccountId",
column: x => x.AccountId,
principalTable: "Accounts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AccountLeftWork_AccountId",
table: "AccountLeftWork",
column: "AccountId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AccountLeftWork");
}
}
}