❔ EF Core migrations
Is it normal that when I do
ef database update
with an unapplied migration, it tries applying all migrations from the start, even though the database already has all of the migrations but the last one? Like it even has a table with migration history so it should automatically detect which migrations haven't been applied yet. Or am I wrong?17 Replies
I think I've renamed some classes, but I left the strings unchanged in the migrations
even if I try applying the last migration specifically, it tries doing the ones before it anyway
afaik ef will only apply the new migrations
ef core can't change the column type from int to uniqueidentifier
like I get why, but how do I work around that?
well yeah that's ehat I expected, but something is wrong on my part apparently
perhaps changing the names did something?
Can I not change the names of anything?
if you change the name in the model then add a new migration ef will then run the new migration
and change whatever it needs to change
well no it just doesn't, it ran all migrations
what could that be?
hmmm that doesnt seem right
maybe ask in #database
reacher or superbrain will be more help than me
actually I checked the database, and found the migration history empty
which is super weird but that was the culprit probably
most likely
so there is a deeper issue there
the history shouldnt be empty
right? if there are tables, there should be at least a row
well that is why ef is running all migrations
because it doesnt think any where already run
yeah
are you doing ef database update after you add a migration?
yeah
it's ok, it's a test database, I've already wiped it
just wondering why there is no history
just want to get to the bottom of this so that things like this don't happen in production
yeah no doubt
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.