Home > Software design >  .NET Core 6 Update-database on server after migration on local machine
.NET Core 6 Update-database on server after migration on local machine

Time:10-16

After releasing my application to the server, I like now to make some update on my database (on the server).

In my application I'm using DbContext (IIdentitycore) then with Nuget manager console generate migration then make update-database, so the database in local is updated.

But now how to apply this update to my database on the server? Is there any why to generate an update SQL query?

I'm using .NET 6 and SQL Server Express.

Thank you

CodePudding user response:

You can generate migration scripts using via Powershell or CLI commands

Script-Migration
dotnet ef migrations script

Or by generating bundle executable file or just applying migrations at runtime at the start of the app.

  • Related