I would like to add a new field to an existing table. I can do add migration and update database commands on the
development environment. I wonder how can I update the production database?
Best Regards.
Keep your friends close and your enemies even closer
I would like to add a new field to an existing table. I can do add migration and update database commands on the
development environment. I wonder how can I update the production database?
It works the same way. Or you can get the TSQL script from the migration and and execute the script. Or you can write code in your app startup that invokes migrations that have not been invoked yet.
Keep in mind, this information is openly available in the official documentation.
Member
527 Points
2728 Posts
Adding New Field With Code First Approach on Production Environment
Apr 22, 2020 12:29 PM|cenk1536|LINK
Hi guys,
I would like to add a new field to an existing table. I can do add migration and update database commands on the development environment. I wonder how can I update the production database?
Best Regards.
All-Star
53691 Points
24030 Posts
Re: Adding New Field With Code First Approach on Production Environment
Apr 22, 2020 12:54 PM|mgebhard|LINK
It works the same way. Or you can get the TSQL script from the migration and and execute the script. Or you can write code in your app startup that invokes migrations that have not been invoked yet.
Keep in mind, this information is openly available in the official documentation.
https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli
Member
527 Points
2728 Posts
Re: Adding New Field With Code First Approach on Production Environment
Apr 22, 2020 03:53 PM|cenk1536|LINK
Thank you, running this script should work.