diff --git a/src/Microsoft.Health.Fhir.SqlServer/Features/Schema/Migrations/69.diff.sql b/src/Microsoft.Health.Fhir.SqlServer/Features/Schema/Migrations/69.diff.sql index ba98ae9b1a..5c08f085e0 100644 --- a/src/Microsoft.Health.Fhir.SqlServer/Features/Schema/Migrations/69.diff.sql +++ b/src/Microsoft.Health.Fhir.SqlServer/Features/Schema/Migrations/69.diff.sql @@ -770,7 +770,7 @@ BEGIN TRY IF NOT EXISTS (SELECT * FROM #SearchParams A - INNER LOOP JOIN dbo.TokenSearchParam B ON B.ResourceTypeId = @ResourceTypeId AND B.SearchParamId = A.SearchParamId + INNER LOOP JOIN dbo.TokenSearchParam B ON B.ResourceTypeId = @ResourceTypeId AND B.SearchParamId = A.SearchParamId AND B.IsHistory = 0 ) BEGIN SET @CurrentMaxSurrogateId = NULL