using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Brizco.Repository.Migrations
{
///
public partial class editShift : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ShiftDays",
schema: "public");
migrationBuilder.DropColumn(
name: "IsRelatedToShift",
schema: "public",
table: "Tasks");
migrationBuilder.DropColumn(
name: "EndAt",
schema: "public",
table: "ShiftPlans");
migrationBuilder.RenameColumn(
name: "StartAt",
schema: "public",
table: "ShiftPlans",
newName: "PlanDate");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "PlanDate",
schema: "public",
table: "ShiftPlans",
newName: "StartAt");
migrationBuilder.AddColumn(
name: "IsRelatedToShift",
schema: "public",
table: "Tasks",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn(
name: "EndAt",
schema: "public",
table: "ShiftPlans",
type: "timestamp without time zone",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.CreateTable(
name: "ShiftDays",
schema: "public",
columns: table => new
{
Id = table.Column(type: "uuid", nullable: false),
ShiftId = table.Column(type: "uuid", nullable: false),
CreatedAt = table.Column(type: "timestamp without time zone", nullable: false),
CreatedBy = table.Column(type: "text", nullable: false),
DayOfWeek = table.Column(type: "integer", nullable: false),
IsRemoved = table.Column(type: "boolean", nullable: false),
ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false),
ModifiedBy = table.Column(type: "text", nullable: false),
RemovedAt = table.Column(type: "timestamp without time zone", nullable: false),
RemovedBy = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ShiftDays", x => x.Id);
table.ForeignKey(
name: "FK_ShiftDays_Shifts_ShiftId",
column: x => x.ShiftId,
principalSchema: "public",
principalTable: "Shifts",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_ShiftDays_ShiftId",
schema: "public",
table: "ShiftDays",
column: "ShiftId");
}
}
}