Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Auto Update-Database after publishing/deploying #4034


User avatar
0
soonjoo created

Hi team, How do I auto update the database to the latest migration files after deploying?

Currently, I have local, development, staging, and production environments each with their own databases. When I deploy to these, i need to manually change the appsettings.json to the target environment, then run the update-database command. I need to do this even when i have appsettings.Development.json, appsettings.Staging.json and appsettings.Production.json set up.

I think it would be a nice feature to add in so it auto updates the database to the latest automatically.


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @soonjoo,

    AspNet Zero does not offer any solution at the moment but you can do it like you do it in any other ASP.NET Core project. Have you checked on the web for this ? I assume this is a common ASP.NET Core stuff.