using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace CompanyManagment.EFCore.Migrations { /// public partial class addrollcallincheckout : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "CheckoutRollCall_TotalBreakTimeSpan", table: "Checkouts", type: "nvarchar(30)", maxLength: 30, nullable: true); migrationBuilder.AddColumn( name: "CheckoutRollCall_TotalMandatoryTimeSpan", table: "Checkouts", type: "nvarchar(30)", maxLength: 30, nullable: true); migrationBuilder.AddColumn( name: "CheckoutRollCall_TotalPaidLeaveTmeSpan", table: "Checkouts", type: "nvarchar(30)", maxLength: 30, nullable: true); migrationBuilder.AddColumn( name: "CheckoutRollCall_TotalPresentTimeSpan", table: "Checkouts", type: "nvarchar(30)", maxLength: 30, nullable: true); migrationBuilder.AddColumn( name: "CheckoutRollCall_TotalSickLeaveTimeSpan", table: "Checkouts", type: "nvarchar(30)", maxLength: 30, nullable: true); migrationBuilder.AddColumn( name: "CheckoutRollCall_TotalWorkingTimeSpan", table: "Checkouts", type: "nvarchar(30)", maxLength: 30, nullable: true); migrationBuilder.CreateTable( name: "CheckoutRollCallDay", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Date = table.Column(type: "datetime2", nullable: false), FirstStartDate = table.Column(type: "nvarchar(18)", maxLength: 18, nullable: true), FirstEndDate = table.Column(type: "nvarchar(18)", maxLength: 18, nullable: true), SecondStartDate = table.Column(type: "nvarchar(18)", maxLength: 18, nullable: true), SecondEndDate = table.Column(type: "nvarchar(18)", maxLength: 18, nullable: true), BreakTimeSpan = table.Column(type: "nvarchar(30)", maxLength: 30, nullable: false), WorkingTimeSpan = table.Column(type: "nvarchar(30)", maxLength: 30, nullable: false), IsSliced = table.Column(type: "bit", nullable: false), IsAbsent = table.Column(type: "bit", nullable: false), IsFriday = table.Column(type: "bit", nullable: false), IsHoliday = table.Column(type: "bit", nullable: false), LeaveType = table.Column(type: "nvarchar(18)", maxLength: 18, nullable: true), CheckoutId = table.Column(type: "bigint", nullable: false) }, constraints: table => { table.PrimaryKey("PK_CheckoutRollCallDay", x => x.Id); table.ForeignKey( name: "FK_CheckoutRollCallDay_Checkouts_CheckoutId", column: x => x.CheckoutId, principalTable: "Checkouts", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_CheckoutRollCallDay_CheckoutId", table: "CheckoutRollCallDay", column: "CheckoutId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "CheckoutRollCallDay"); migrationBuilder.DropColumn( name: "CheckoutRollCall_TotalBreakTimeSpan", table: "Checkouts"); migrationBuilder.DropColumn( name: "CheckoutRollCall_TotalMandatoryTimeSpan", table: "Checkouts"); migrationBuilder.DropColumn( name: "CheckoutRollCall_TotalPaidLeaveTmeSpan", table: "Checkouts"); migrationBuilder.DropColumn( name: "CheckoutRollCall_TotalPresentTimeSpan", table: "Checkouts"); migrationBuilder.DropColumn( name: "CheckoutRollCall_TotalSickLeaveTimeSpan", table: "Checkouts"); migrationBuilder.DropColumn( name: "CheckoutRollCall_TotalWorkingTimeSpan", table: "Checkouts"); } } }