Applying migrations in production CMS approach

Solution:

  1. Database.Migrate only applies migrations that have been generated. This is the same as command dotnet ef database update from CLI.
  2. No, it does not. This is the thing that you need to do on your own or automate it with tool / script – documentation
  3. As mentioned before it does not add any NEW migrations, only applies them.
  4. I don’ think you can do it. An easier way would be to create some script on deploy that will do the thing you want and revert the database in case of failure. I also advise you to think about migration that will affect data. What if someone will generate migration that will cause the lost of data?