I migrate an ASP.NET Core project from 3.1 to 6.0.
I have copied old migration and pasted it to our new version
Migration on EF Core 3.1 (old)
migrationBuilder.AddColumn<DateTime>(
name: "CalendarStartDate",
table: "DealOverview",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
Migration in EF Core 6.0 (new)
migrationBuilder.AlterColumn<DateTime>(
name: "StartDate",
table: "DealOverview",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
The migration fails because this line
public DateTime StartDate { get; set; }
has changed.
I went from this package:
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />
to this package:
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.1" />