using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace barkmanapi.Migrations
{
///
public partial class splitdatetimeIntoSeprateFeileds : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn(
name: "start_date",
table: "jobs",
type: "date",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn(
name: "end_date",
table: "jobs",
type: "date",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AddColumn(
name: "end_time",
table: "jobs",
type: "time without time zone",
nullable: false,
defaultValue: new TimeOnly(0, 0, 0));
migrationBuilder.AddColumn(
name: "start_time",
table: "jobs",
type: "time without time zone",
nullable: false,
defaultValue: new TimeOnly(0, 0, 0));
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "end_time",
table: "jobs");
migrationBuilder.DropColumn(
name: "start_time",
table: "jobs");
migrationBuilder.AlterColumn(
name: "start_date",
table: "jobs",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateOnly),
oldType: "date");
migrationBuilder.AlterColumn(
name: "end_date",
table: "jobs",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateOnly),
oldType: "date");
}
}
}