96 lines
5.0 KiB
C#
96 lines
5.0 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace CompanyManagment.EFCore.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class TaxLeftWorkTables : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "TaxLeftWorkCategory",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<long>(type: "bigint", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
WorkshopId = table.Column<long>(type: "bigint", nullable: false),
|
|
WorkshopName = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
|
|
EmployeeId = table.Column<long>(type: "bigint", nullable: false),
|
|
EmployeeName = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
|
|
RetirementDate = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
|
|
JobTitle = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
|
|
JobCategoryCode = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: true),
|
|
JobCategoryId = table.Column<long>(type: "bigint", nullable: false),
|
|
TypeOfEmployment = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: true),
|
|
EmploymentLocationStatus = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: true),
|
|
TypeOfInsurance = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: true),
|
|
InsuranceName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
|
InsuranceBranch = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
|
TaxExempt = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: true),
|
|
BudgetLawExceptions = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: true),
|
|
PaymentType = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: true),
|
|
CurrencyType = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: true),
|
|
Country = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: true),
|
|
ExchangeRate = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: true),
|
|
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_TaxLeftWorkCategory", x => x.id);
|
|
table.ForeignKey(
|
|
name: "FK_TaxLeftWorkCategory_Workshops_WorkshopId",
|
|
column: x => x.WorkshopId,
|
|
principalTable: "Workshops",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "TaxLeftWorkItem",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<long>(type: "bigint", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
StartWork = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
LeftWork = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
TaxLeftWorkCategoryId = table.Column<long>(type: "bigint", nullable: false),
|
|
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_TaxLeftWorkItem", x => x.id);
|
|
table.ForeignKey(
|
|
name: "FK_TaxLeftWorkItem_TaxLeftWorkCategory_TaxLeftWorkCategoryId",
|
|
column: x => x.TaxLeftWorkCategoryId,
|
|
principalTable: "TaxLeftWorkCategory",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_TaxLeftWorkCategory_WorkshopId",
|
|
table: "TaxLeftWorkCategory",
|
|
column: "WorkshopId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_TaxLeftWorkItem_TaxLeftWorkCategoryId",
|
|
table: "TaxLeftWorkItem",
|
|
column: "TaxLeftWorkCategoryId");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "TaxLeftWorkItem");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "TaxLeftWorkCategory");
|
|
}
|
|
}
|
|
}
|