Files
DevOps/5/Data/Migrations/Sqlite/20260329123145_DateOnlyColumns.cs
2026-04-07 20:35:53 +02:00

52 lines
1.5 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Example.Data.Migrations.Sqlite
{
/// <inheritdoc />
public partial class DateOnlyColumns : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "Published",
table: "Books",
type: "date",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "TEXT");
migrationBuilder.AlterColumn<DateTime>(
name: "Birthdate",
table: "Authors",
type: "date",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "TEXT");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "Published",
table: "Books",
type: "TEXT",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "date");
migrationBuilder.AlterColumn<DateTime>(
name: "Birthdate",
table: "Authors",
type: "TEXT",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "date");
}
}
}