Files
barkman/barkmanAPI/Migrations/20260725205905_splitdatetimeIntoSeprateFeileds.cs
T

74 lines
2.3 KiB
C#

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");
}
}
}