it:ad:code_first:migrations:howto:enable_or_disable_automatic_migrations

IT:AD:EF/CodeFirst/Migrations:HowTo:Enable or Disable Automatic Migrations

## Summary

When Enabling a Project for CodeFirst Migrations (IT:AD:EF/CodeFirst/Migrations:HowTo:Enable-Migrations), the default is to have Automatic CodeFirst Migrations turned off

Note: but there is an optional flag to turn it on as you Enable your project.

But you can always Enable or Disable Code Migrations later.

Find the Configuration.cs in the Migrations folder created in the root of your Project when you used Enable-Migrations.

Change the AutomaticMigrationsEnabled value.

    internal sealed class Configuration : DbMigrationsConfiguration<App.Core.Infrastructure.Data.AppDbContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
        }
    }

  • /home/skysigal/public_html/data/pages/it/ad/code_first/migrations/howto/enable_or_disable_automatic_migrations.txt
  • Last modified: 2023/11/04 02:19
  • by 127.0.0.1