access_time 2 years ago languageEnglish
more_horiz

EntityFramework Core Database Migration in Azure DevOps Pipeline

visibility 3,764 comment 4
EntityFramework Core is a commonly used framework in .NET Core applications to access and manage data in a database like SQL Server. When using code-first approach, migration scripts are generated using CLI tool and then database update command is used to apply the changes to databases. To perform ...
info Last modified by Administrator 6 months ago
thumb_up 0

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

comment Comments
5 months ago link more_horiz
Raymond Raymond
web_assetArticles 586
imageDiagrams 41
forumThreads 9
commentComments 220
loyaltyKontext Points 6330
account_circleProfile
#1620 Re: EntityFramework Core Database Migration in Azure DevOps Pipeline

It depends on:

  • Whether your portals and functions share the same database?
  • Whether you are using a single project for storing migration C# scripts.

For my case, there is only one website portal and one shared migration project (where all migration C# scripts locate); thus I just used those two projects.

format_quote

person Uday access_time 5 months ago
Re: EntityFramework Core Database Migration in Azure DevOps Pipeline

In Entity framework core migration script generator task
which path should be given for Main project path and DB context
as we have 6 portals and 15 function apps in one Repo

5 months ago link more_horiz
U
Uday
web_assetArticles 0
imageDiagrams 0
forumThreads 0
commentComments 2
loyaltyKontext Points 2
#1619 Re: EntityFramework Core Database Migration in Azure DevOps Pipeline

In Entity framework core migration script generator task
which path should be given for Main project path and DB context
as we have 6 portals and 15 function apps in one Repo

5 months ago link more_horiz
Raymond Raymond
web_assetArticles 586
imageDiagrams 41
forumThreads 9
commentComments 220
loyaltyKontext Points 6330
account_circleProfile
#1618 Re: EntityFramework Core Database Migration in Azure DevOps Pipeline

There are several things you can do:

1) Backup your database before migration so that you can restore if any failure.

2) You can use dotnet ef migrations script to generate roll back script too.

For example, the following command will generate scripts to roll back from a migration named LatestMigrationName to PreviousMigrationName.

dotnet ef migrations script LatestMigrationName PreviousMigrationName


format_quote

person Uday access_time 5 months ago
Re: EntityFramework Core Database Migration in Azure DevOps Pipeline

how can we rollback the Migration in case of failure

5 months ago link more_horiz
U
Uday
web_assetArticles 0
imageDiagrams 0
forumThreads 0
commentComments 2
loyaltyKontext Points 2
#1617 Re: EntityFramework Core Database Migration in Azure DevOps Pipeline

how can we rollback the Migration in case of failure

timeline Stats
Page index 8.45