Hello all,
I am having issue updating the migration of my database. I am currently using .NET 9.0. I have modified one of my files to include the following:
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "DiaryEntries",
keyColumn: "Id",
keyValue: 1,
column: "Created",
value: new DateTime(2024, 9, 16, 12, 6, 6, 691, DateTimeKind.Local).AddTicks(2342));
migrationBuilder.UpdateData(
table: "DiaryEntries",
keyColumn: "Id",
keyValue: 2,
column: "Created",
value: new DateTime(2024, 9, 16, 12, 6, 6, 691, DateTimeKind.Local).AddTicks(2642));
migrationBuilder.UpdateData(
table: "DiaryEntries",
keyColumn: "Id",
keyValue: 3,
column: "Created",
value: new DateTime(2024, 9, 16, 12, 6, 6, 691, DateTimeKind.Local).AddTicks(2646));
}
Unfortunately when I do add-migration AddedSeedingDataDiaryEntry
followed by update-database
it comes with this error message:
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
An error was generated for warning 'Microsoft.EntityFrameworkCore.Migrations.PendingModelChangesWarning': The model for context 'ApplicationDbContext' has pending changes. Add a new migration before updating the database. This exception can be suppressed or logged by passing event ID 'RelationalEventId.PendingModelChangesWarning' to the 'ConfigureWarnings' method in 'DbContext.OnConfiguring' or 'AddDbContext'.
How do I update the database to help with pending changes? I have already added the migration and I see the file there, but this error message makes it look like the migration was never added.