diff --git a/src/Libraries/Nop.Data/Migrations/UpgradeTo480/AddIndexesMigration.cs b/src/Libraries/Nop.Data/Migrations/UpgradeTo480/AddIndexesMigration.cs index c4811b077f6..9814dc5bcad 100644 --- a/src/Libraries/Nop.Data/Migrations/UpgradeTo480/AddIndexesMigration.cs +++ b/src/Libraries/Nop.Data/Migrations/UpgradeTo480/AddIndexesMigration.cs @@ -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().GroupBy(p => p.OrderGuid, p => p) .Where(p => p.Count() > 1)