C
C#2y ago
Simo

❔ ef migration snapshots

If I use the same project to deploy to dev and then live, do I need to clear the model snapshots? it seems it may hold dev-relevant information in there and mess up the live migration (I've noticed some of our migrations appear to not be included on live now)
5 Replies
Patrick
Patrick2y ago
you do not touch the snapshot it is how EF determines what has changed in your code consider it a "serialized" representation of your database in C#. If you delete or modify it, EF will regenerate previous migration-code and EF will lose history over what it has already generated a migration for
Simo
SimoOP2y ago
I didn't touch it but I did migrate to a different environment which was at a different migration so was curious if using the same snapshot is fine between multiple environments in this case a migration which updated seed data hasnt been applied and trying to figure out why so now live has different data in a table, and ef seems happy
Patrick
Patrick2y ago
the snapshot is fine between environments, it's just how EF figures out what to apply/change codewise
Simo
SimoOP2y ago
hmm then I wonder what the heck is going on everything else looks the same (minus names of constraints etc)
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server