61 lines
3.4 KiB
C#
61 lines
3.4 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
namespace CompanyManagment.EFCore.Migrations
|
|
{
|
|
public partial class EmployerAdd : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "Employers",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<long>(type: "bigint", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
FName = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
|
LName = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
|
ContractingPartyId = table.Column<long>(type: "bigint", nullable: false),
|
|
IsActive = table.Column<bool>(type: "bit", nullable: false),
|
|
Gender = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false),
|
|
Nationalcode = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false),
|
|
IdNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
|
|
Nationality = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
|
FatherName = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
|
DateOfBirth = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
DateOfIssue = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
PlaceOfIssue = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
RegisterId = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
|
|
NationalId = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
|
|
EmployerLName = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
|
IsLegal = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false),
|
|
Phone = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
AgentPhone = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
Address = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
|
|
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Employers", x => x.id);
|
|
table.ForeignKey(
|
|
name: "FK_Employers_PersonalContractingParties_ContractingPartyId",
|
|
column: x => x.ContractingPartyId,
|
|
principalTable: "PersonalContractingParties",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Employers_ContractingPartyId",
|
|
table: "Employers",
|
|
column: "ContractingPartyId");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Employers");
|
|
}
|
|
}
|
|
}
|