I am trying to prepare a new project for continuous integration. My project is written in .Net Core and uses Entity Framework Core for Database access. What I need to try and do is add a pre-build step in my project to add a new migration. I have already setup the webapp to apply all migrations on startup, but did not really want to have to manually create migrations before committing my code. I believe that should be part of the CI setup as I may go through hundreds of database changes during development, but when I deploy my latest code I would like to have a migration script for each version released.
I am currently using v1.1.0 of all nuget dependancies for .Net Core and EF Core.
EDIT: The link from J.Pichardo is similar to what I am asking. But from what I can tell it is about applying migrations (which I have already got working in my code).
Answer from bricelam may work as a code version of what I am trying to accomplish. But, I was hoping there was a way to configure the project.json file so that it would run the Add-Migration script using a generated name for the migration (ideally by using environment variables which can be set by my CI).
This would then allow me to manually create migrations during development, but then let my CI create complete migrations during the final stage of each release process.