Skip to content

Should we always migrate the DB? #1256

Answered by jasontaylordev
fossbrandon asked this question in Q&A
Discussion options

You must be logged in to vote

The strategy mentioned initialises the database on application startup while preserving existing data. This is a productive and simple strategy for local development environments. However, it is not appropriate for other environments, such as staging and production. For these environments, database initialisation should occur during deployment.

https://jasontaylor.dev/ef-core-database-initialisation-strategies/
https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations/applying?tabs=dotnet-core-cli#apply-migrations-at-runtime

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fossbrandon
Comment options

Answer selected by fossbrandon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants