简体   繁体   中英

How to handle multiple migrationproviders(SQLite, AzureSQL) with ef core?

Trying to create .NET Core 3.0(generic host) app with database access and deploy it to Azure App Service. As indicated by examples in official Microsoft Documentation, you can use SQLite DB for local development and Azure SQL for production when deployed to Azure App Service.

Problems I get are related to migrations, local migrations for SQLite works fine, but these SQLite migrations doesn't seem to be fully compatible with Azure SQL so SQLDB creation fails when deploying to Azure and trying to apply the migrations from local SQLite.

What is the recommended way to handle a situation like this when you like to use a local db for dev and another one(Azure SQLDb) for production?

I use VSCode on macOS as my dev environment.

You should either develop directly against an Azure or Azure Stack SQL database, perhaps in your own developer subscription if you're a VS subscriber, or resolve the issues identified by using the Data Migration Assistant (DMA) which can be found here:

https://www.microsoft.com/en-us/download/details.aspx?id=53595

Edit: This requires a Windows machine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM