How to cancel EF migration to Azure

HELP! I have an MVC4 application hosted on Azure. First I use the EF code. Here is my scenario:

  • I set a flag in my production database so that the website displays the message "website is disabled" instead of the usual behavior on the website.

  • I posted a website code update for the Staging instance. When I started the intermediate instance, it applied some migrations to the database schema. At this point, the production instance will not work if I have to turn it back on because the database schema is not compatible with the production code

  • When I tested the middleware instance, I found that it was not working correctly.

Now I understand that I don’t know how to cancel the EF migrations that I applied so that I can turn on the Production instance again and go back to where I was before I started Instance Swapping. I know how to use the package manager console in Visual Studio to switch to a specific migration in a local database, but I have no idea how to manually tell Azure to update the database for a specific migration.

+4
source share
2 answers

Azure " ". ADO.NET -ConnectionString Update-Database. - :

Update-Database 
-TargetMigration {YourMigration} 
-ConnectionString "Server=tcp:{your server name}.database.windows.net,1433;
                   Database={your db};
                   User ID={your user}@{your server};
                   Password={your password};
                   Trusted_Connection=False;
                   Encrypt=True;
                   Connection Timeout=30;" 
-ConnectionProviderName "System.Data.SqlClient"
+12

a "Get-Migrations"

.

:

Update-Database -TargetMigration:"{NAME_OF_SELECTED_MIGRATION}"

{NAME_OF_SELECTED_MIGRATION} , . PS: "{" "}".

+3

All Articles