Skip to content

Commit

Permalink
#7377 Mark the Order.OrderGuid field as unique in the database. Fix o…
Browse files Browse the repository at this point in the history
…n check exists constraint
  • Loading branch information
skoshelev committed Dec 12, 2024
1 parent d5397b1 commit 0334c75
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public override void Up()
.WithOptions().NonClustered();

//#7377
if (!Schema.Table(nameof(Order)).Constraint("AK_Order_OrderGuid").Exists())
if (!Schema.Table(nameof(Order)).Index("AK_Order_OrderGuid").Exists() &&
!Schema.Table(nameof(Order)).Constraint("AK_Order_OrderGuid").Exists())
{
var orders = _dataProvider.GetTable<Order>().GroupBy(p => p.OrderGuid, p => p)
.Where(p => p.Count() > 1)
Expand Down

0 comments on commit 0334c75

Please sign in to comment.