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

94 lines
4.5 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace CompanyManagment.EFCore.Migrations
{
public partial class institutionContract : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "ToDate",
table: "PenaltyTitles",
type: "datetime2(7)",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "datetime2",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "FromDate",
table: "PenaltyTitles",
type: "datetime2(7)",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "datetime2",
oldNullable: true);
migrationBuilder.CreateTable(
name: "InstitutionContracts",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ContractNo = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
RepresentativeId = table.Column<long>(type: "bigint", nullable: false),
RepresentativeName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ContractingPartyId = table.Column<long>(type: "bigint", nullable: false),
ContractingPartyName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ContractDateGr = table.Column<DateTime>(type: "datetime2", nullable: false),
ContractDateFa = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
State = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
City = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
Address = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: true),
ContactInfoId = table.Column<long>(type: "bigint", nullable: false),
ContractStartGr = table.Column<DateTime>(type: "datetime2", nullable: false),
ContractStartFa = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
ContractEndGr = table.Column<DateTime>(type: "datetime2", nullable: false),
ContractEndFa = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
ContractAmount = table.Column<double>(type: "float", nullable: false),
DailyCompenseation = table.Column<double>(type: "float", nullable: false),
Obligation = table.Column<double>(type: "float", nullable: false),
TotalAmount = table.Column<double>(type: "float", nullable: false),
Month = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
Year = table.Column<string>(type: "nvarchar(4)", maxLength: 4, nullable: true),
IsActiveString = table.Column<string>(type: "nvarchar(5)", maxLength: 5, nullable: true),
ExtensionNo = table.Column<int>(type: "int", nullable: false),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_InstitutionContracts", x => x.id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "InstitutionContracts");
migrationBuilder.AlterColumn<DateTime>(
name: "ToDate",
table: "PenaltyTitles",
type: "datetime2",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "datetime2(7)",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "FromDate",
table: "PenaltyTitles",
type: "datetime2",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "datetime2(7)",
oldNullable: true);
}
}
}