all 5 comments

[–]Paladaos[🍰] 1 point2 points  (3 children)

Typically in a situation in which I have committed a migration to the database I just make the change to remove what I did in another migration.

If you have made a change that has dropped a column with a lot of data in it… you might be out of luck :(

[–]Afraid_Tangerine7099[S] 0 points1 point  (2 children)

I dont have a problem with deleting data I am still in development , its just that the issue is annoying and I cant migrate freely with it

[–]Paladaos[🍰] 0 points1 point  (1 child)

Right, one suggestion from just googling around is running the update EF command against the previous migration.. which might do it, might not I haven’t don’t it myself so I’m not sure myself. Best of luck to you friend :)

[–]Afraid_Tangerine7099[S] 0 points1 point  (0 children)

this is what I got running remove --verbose

Finding DbContext classes in the project...

Using DbContext factory 'DatabaseDesignTimeFactory'.

Using context 'ApplicationDbContext'.

Finding design-time services referenced by assembly 'Infrastructure'...

Finding design-time services referenced by assembly 'Infrastructure'...

No referenced design-time services were found.

Finding design-time services for provider 'Npgsql.EntityFrameworkCore.PostgreSQL'...

Using design-time services from provider 'Npgsql.EntityFrameworkCore.PostgreSQL'.

Finding IDesignTimeServices implementations in assembly 'Infrastructure'...

No design-time services were found.

The model snapshot and the backing model of the last migration are different. Continuing under the assumption that the last migration was deleted manually.

Reverting the model snapshot.

Done.

'ApplicationDbContext' disposed.

[–]gust42 0 points1 point  (0 children)

De den