Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Migration failed to add a field to the CatalogItem entity in CatalogContext of Catalog.API #1518

@anjoy8

Description

@anjoy8

1.First, I added a String field: Tests

public string Tests { get; set; }

2.Then, to perform the migration:

 add - migration AddTests - c CatalogContext - o Infrastructure/CatalogMigrations

3.Finally, execute the project(or update-database) and report an error

image


After Debugging the source code, I found that the last migration record was not synchronized into the model snapshot.

This submission record has been modified.
(45ed8a6)
But the snapshot file has not changed.
https://github.com/dotnet-architecture/eShopOnContainers/blob/dev/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/CatalogContextModelSnapshot.cs)

Causes new fields to be added to conflict.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions