192 lines
8.5 KiB
C#
192 lines
8.5 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace CompanyManagment.EFCore.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class addheaderproperiesincustomizecheckout : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<TimeOnly>(
|
|
name: "IrregularShift_EndTime",
|
|
table: "CustomizeCheckoutTemps",
|
|
type: "time",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<TimeOnly>(
|
|
name: "IrregularShift_StartTime",
|
|
table: "CustomizeCheckoutTemps",
|
|
type: "time",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "IrregularShift_WorkshopIrregularShifts",
|
|
table: "CustomizeCheckoutTemps",
|
|
type: "nvarchar(30)",
|
|
maxLength: 30,
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<TimeOnly>(
|
|
name: "IrregularShift_EndTime",
|
|
table: "CustomizeCheckouts",
|
|
type: "time",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<TimeOnly>(
|
|
name: "IrregularShift_StartTime",
|
|
table: "CustomizeCheckouts",
|
|
type: "time",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "IrregularShift_WorkshopIrregularShifts",
|
|
table: "CustomizeCheckouts",
|
|
type: "nvarchar(30)",
|
|
maxLength: 30,
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "CustomizeCheckouts_CustomizeRotatingShifts",
|
|
columns: table => new
|
|
{
|
|
CustomizeCheckoutid = table.Column<long>(type: "bigint", nullable: false),
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
StartTime = table.Column<TimeOnly>(type: "time", nullable: false),
|
|
EndTime = table.Column<TimeOnly>(type: "time", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_CustomizeCheckouts_CustomizeRotatingShifts", x => new { x.CustomizeCheckoutid, x.Id });
|
|
table.ForeignKey(
|
|
name: "FK_CustomizeCheckouts_CustomizeRotatingShifts_CustomizeCheckouts_CustomizeCheckoutid",
|
|
column: x => x.CustomizeCheckoutid,
|
|
principalTable: "CustomizeCheckouts",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "CustomizeCheckouts_RegularShifts",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<long>(type: "bigint", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
CustomizeCheckoutid = table.Column<long>(type: "bigint", nullable: false),
|
|
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
StartTime = table.Column<TimeOnly>(type: "time", nullable: false),
|
|
EndTime = table.Column<TimeOnly>(type: "time", nullable: false),
|
|
Placement = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_CustomizeCheckouts_RegularShifts", x => x.id);
|
|
table.ForeignKey(
|
|
name: "FK_CustomizeCheckouts_RegularShifts_CustomizeCheckouts_CustomizeCheckoutid",
|
|
column: x => x.CustomizeCheckoutid,
|
|
principalTable: "CustomizeCheckouts",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "CustomizeCheckoutTemps_CustomizeRotatingShifts",
|
|
columns: table => new
|
|
{
|
|
CustomizeCheckoutTempid = table.Column<long>(type: "bigint", nullable: false),
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
StartTime = table.Column<TimeOnly>(type: "time", nullable: false),
|
|
EndTime = table.Column<TimeOnly>(type: "time", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_CustomizeCheckoutTemps_CustomizeRotatingShifts", x => new { x.CustomizeCheckoutTempid, x.Id });
|
|
table.ForeignKey(
|
|
name: "FK_CustomizeCheckoutTemps_CustomizeRotatingShifts_CustomizeCheckoutTemps_CustomizeCheckoutTempid",
|
|
column: x => x.CustomizeCheckoutTempid,
|
|
principalTable: "CustomizeCheckoutTemps",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "CustomizeCheckoutTemps_RegularShifts",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<long>(type: "bigint", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
CustomizeCheckoutTempid = table.Column<long>(type: "bigint", nullable: false),
|
|
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
StartTime = table.Column<TimeOnly>(type: "time", nullable: false),
|
|
EndTime = table.Column<TimeOnly>(type: "time", nullable: false),
|
|
Placement = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_CustomizeCheckoutTemps_RegularShifts", x => x.id);
|
|
table.ForeignKey(
|
|
name: "FK_CustomizeCheckoutTemps_RegularShifts_CustomizeCheckoutTemps_CustomizeCheckoutTempid",
|
|
column: x => x.CustomizeCheckoutTempid,
|
|
principalTable: "CustomizeCheckoutTemps",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_CustomizeCheckouts_RegularShifts_CustomizeCheckoutid",
|
|
table: "CustomizeCheckouts_RegularShifts",
|
|
column: "CustomizeCheckoutid");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_CustomizeCheckoutTemps_RegularShifts_CustomizeCheckoutTempid",
|
|
table: "CustomizeCheckoutTemps_RegularShifts",
|
|
column: "CustomizeCheckoutTempid");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "CustomizeCheckouts_CustomizeRotatingShifts");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "CustomizeCheckouts_RegularShifts");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "CustomizeCheckoutTemps_CustomizeRotatingShifts");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "CustomizeCheckoutTemps_RegularShifts");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "IrregularShift_EndTime",
|
|
table: "CustomizeCheckoutTemps");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "IrregularShift_StartTime",
|
|
table: "CustomizeCheckoutTemps");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "IrregularShift_WorkshopIrregularShifts",
|
|
table: "CustomizeCheckoutTemps");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "IrregularShift_EndTime",
|
|
table: "CustomizeCheckouts");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "IrregularShift_StartTime",
|
|
table: "CustomizeCheckouts");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "IrregularShift_WorkshopIrregularShifts",
|
|
table: "CustomizeCheckouts");
|
|
}
|
|
}
|
|
}
|