Files
Backend-Api/CompanyManagment.EFCore/Migrations/20240530140019_InstitutionPlanTable.cs
2024-07-05 21:36:15 +03:30

75 lines
3.3 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class InstitutionPlanTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "InstitutionPlan",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
FinalContractAmont = table.Column<double>(type: "float", nullable: false),
IncreasePercentage = table.Column<double>(type: "float", nullable: false),
BaseContractAmont = table.Column<double>(type: "float", nullable: false),
CountPerson = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_InstitutionPlan", x => x.id);
});
migrationBuilder.CreateTable(
name: "RollCallServices",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ServiceType = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
StartService = table.Column<DateTime>(type: "datetime2", nullable: false),
EndService = table.Column<DateTime>(type: "datetime2", nullable: false),
WorkshopId = table.Column<long>(type: "bigint", nullable: false),
AccountId = table.Column<long>(type: "bigint", nullable: false),
IsActiveString = table.Column<string>(type: "nvarchar(5)", maxLength: 5, nullable: true),
MaxPersonValid = table.Column<int>(type: "int", nullable: false),
Amount = table.Column<double>(type: "float", nullable: false),
Duration = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: true),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_RollCallServices", x => x.id);
table.ForeignKey(
name: "FK_RollCallServices_Workshops_AccountId",
column: x => x.AccountId,
principalTable: "Workshops",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_RollCallServices_AccountId",
table: "RollCallServices",
column: "AccountId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "InstitutionPlan");
migrationBuilder.DropTable(
name: "RollCallServices");
}
}
}