-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide guidance for deploying migrations #691
Comments
Really pleased to see this has been raised - looking forward to hearing more! |
Copying the address of @johnnyreilly’s blog post here: https://blog.johnnyreilly.com/2018/06/vsts-and-ef-core-migrations.html |
Looking forward to "official" guidelines. Until then, here's what I'm doing which i find to be a quite nice and straightforward solution without creating an additional console app:
That's it - it's straightforward and works nicely, fits perfectly in a Continous Deployment scenario and allowing us to use a deployment user with all necessary rights to change database schemas - while during app runtime, I can run with a different user that has only datareader/datawriter rights. There is just one drawback: The generated script does not create the database if it does not exist on the first deployment. So the DB has to be there and prepared - or, and that is what I have done, I added an additional I think it's an ok thing to do, but I'd love to have the possibility to optionally add create database SQL with |
See also dotnet/efcore#13339 |
I’m also looking forward to some good documentation about how to create database migrations in Azure Pipelines with ASP.NET Core. It was a lot of trial and error before I got it right. That said, I wrote a little task to make this easier :-) I created Entity Framework Core Migrations Script Generator: It takes care of the part of generating script, the hardest part according to me. |
This would primarily be:
The text was updated successfully, but these errors were encountered: