Migrate Show.Date from DateOnly to DateTime to support time of day

Removes DateOnly/DateTime conversion boilerplate from all Show endpoints
and adds the corresponding EF Core migration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-02 18:01:12 +02:00
parent b3612f5bec
commit 71b7a53e59
8 changed files with 1997 additions and 12 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,37 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PyroFetes.Migrations
{
/// <inheritdoc />
public partial class DateTimeForShow : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "Date",
table: "Shows",
type: "datetime2",
nullable: true,
oldClrType: typeof(DateOnly),
oldType: "date",
oldNullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateOnly>(
name: "Date",
table: "Shows",
type: "date",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "datetime2",
oldNullable: true);
}
}
}
@@ -816,8 +816,8 @@ namespace PyroFetes.Migrations
b.Property<int?>("CityId")
.HasColumnType("int");
b.Property<DateOnly?>("Date")
.HasColumnType("date");
b.Property<DateTime?>("Date")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasMaxLength(500)
@@ -887,7 +887,7 @@ namespace PyroFetes.Migrations
b.HasIndex("TruckId");
b.ToTable("ShowTruck");
b.ToTable("ShowTrucks");
});
modelBuilder.Entity("PyroFetes.Models.Sound", b =>
@@ -1593,8 +1593,7 @@ namespace PyroFetes.Migrations
{
b.HasOne("PyroFetes.Models.City", "City")
.WithMany("Shows")
.HasForeignKey("CityId")
.OnDelete(DeleteBehavior.ClientSetNull);
.HasForeignKey("CityId");
b.Navigation("City");
});