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

125 lines
8.2 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace CompanyManagment.EFCore.Migrations
{
public partial class FilemployeeAndFileEmployerAdded : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "FileEmployee",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
FName = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
LName = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
RepresentativeId = table.Column<long>(type: "bigint", nullable: false),
RepresentativeFullName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
FatherName = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
DateOfBirth = table.Column<DateTime>(type: "datetime2", nullable: false),
NationalCode = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
IdNumber = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true),
Gender = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
MaritalStatus = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
LevelOfEducation = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true),
FieldOfStudy = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
InsuranceCode = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
Phone = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
OfficePhone = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
MclsUserName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
MclsPassword = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
EserviceUserName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
EservicePassword = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
TaxOfficeUserName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
TaxOfficepassword = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
SanaUserName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
SanaPassword = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
IsActive = table.Column<string>(type: "nvarchar(5)", maxLength: 5, nullable: true),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FileEmployee", x => x.id);
table.ForeignKey(
name: "FK_FileEmployee_Representative_RepresentativeId",
column: x => x.RepresentativeId,
principalTable: "Representative",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "FileEmployer",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
FName = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
LName = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
LegalName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
FullName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
RepresentativeId = table.Column<long>(type: "bigint", nullable: false),
RepresentativeFullName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
DateOfBirth = table.Column<DateTime>(type: "datetime2", nullable: false),
InsuranceWorkshopCode = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
NationalCode = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
LevelOfEducation = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true),
FieldOfStudy = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
IdNumber = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true),
Gender = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
MaritalStatus = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
RegisterId = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
NationalId = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
IsLegal = table.Column<string>(type: "nvarchar(5)", maxLength: 5, nullable: true),
Phone = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
OfficePhone = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
MclsUserName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
MclsPassword = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
EserviceUserName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
EservicePassword = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
TaxOfficeUserName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
TaxOfficepassword = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
SanaUserName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
SanaPassword = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
IsActive = table.Column<string>(type: "nvarchar(5)", maxLength: 5, nullable: true),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FileEmployer", x => x.id);
table.ForeignKey(
name: "FK_FileEmployer_Representative_RepresentativeId",
column: x => x.RepresentativeId,
principalTable: "Representative",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_FileEmployee_RepresentativeId",
table: "FileEmployee",
column: "RepresentativeId");
migrationBuilder.CreateIndex(
name: "IX_FileEmployer_RepresentativeId",
table: "FileEmployer",
column: "RepresentativeId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "FileEmployee");
migrationBuilder.DropTable(
name: "FileEmployer");
}
}
}