Skip to content

Add migration update all seeded data #18943

@ciacco85

Description

@ciacco85

First of all, I had to put on stand-by ef core 3 upgrade due to this issue
#18297
duplicate of
#17851
released on 3.1-preview2

Every time I add a migration, all seeded data are updated, so thousand line of code for each migration.
Here it is an example
migrationBuilder.UpdateData( table: "Countries", keyColumn: "Id", keyValue: new Guid("5c60f693-bef5-e011-a587-80ee7300c695"), columns: new[] { "CurrencyId", "DefaultLanguageId" }, values: new object[] { new Guid("7d76825e-4470-4b45-a5b9-bd96267685c0"), new Guid("deb5f6a8-2e81-47c3-bd10-a89c43919dd7") });

This has happen to me in the past only when i use DateTime.Now in seed because, obviously, the value changes every time I add a migration, but not with GUID

Further technical details

EF Core version:
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: 3.1.100-preview3-014645
Operating system: latest stable VS2019, W10

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions