seperated out start and end date and time into seprate date and time fields

This commit is contained in:
2026-07-25 15:59:46 -05:00
parent 5517924259
commit 1b478cd7ba
7 changed files with 712 additions and 6 deletions
@@ -0,0 +1,73 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace barkmanapi.Migrations
{
/// <inheritdoc />
public partial class splitdatetimeIntoSeprateFeileds : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateOnly>(
name: "start_date",
table: "jobs",
type: "date",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateOnly>(
name: "end_date",
table: "jobs",
type: "date",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AddColumn<TimeOnly>(
name: "end_time",
table: "jobs",
type: "time without time zone",
nullable: false,
defaultValue: new TimeOnly(0, 0, 0));
migrationBuilder.AddColumn<TimeOnly>(
name: "start_time",
table: "jobs",
type: "time without time zone",
nullable: false,
defaultValue: new TimeOnly(0, 0, 0));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "end_time",
table: "jobs");
migrationBuilder.DropColumn(
name: "start_time",
table: "jobs");
migrationBuilder.AlterColumn<DateTime>(
name: "start_date",
table: "jobs",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateOnly),
oldType: "date");
migrationBuilder.AlterColumn<DateTime>(
name: "end_date",
table: "jobs",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateOnly),
oldType: "date");
}
}
}