mirror of
https://github.com/BarkProductions/barkman.git
synced 2026-08-11 11:42:03 +00:00
seperated out start and end date and time into seprate date and time fields
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user