Skip to content

Commit 0334c75

Browse files
committed
#7377 Mark the Order.OrderGuid field as unique in the database. Fix on check exists constraint
1 parent d5397b1 commit 0334c75

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Libraries/Nop.Data/Migrations/UpgradeTo480/AddIndexesMigration.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ public override void Up()
2727
.WithOptions().NonClustered();
2828

2929
//#7377
30-
if (!Schema.Table(nameof(Order)).Constraint("AK_Order_OrderGuid").Exists())
30+
if (!Schema.Table(nameof(Order)).Index("AK_Order_OrderGuid").Exists() &&
31+
!Schema.Table(nameof(Order)).Constraint("AK_Order_OrderGuid").Exists())
3132
{
3233
var orders = _dataProvider.GetTable<Order>().GroupBy(p => p.OrderGuid, p => p)
3334
.Where(p => p.Count() > 1)

0 commit comments

Comments
 (0)