FluentMigrator - Index already exists

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
Hello

This is regarding the update version 2020-06-10

I'm updating my code to the latest in dev and keep crashing on it trying to add the same index that already exists in my existing database.   This is happening across multiple indexes.  It seems there should be an additional check in the fluent code to check if the index already exists.  

What is the best way to get past this?

: 'An error occured executing the following sql:
CREATE INDEX [IX_PSAM_AllowFiltering] ON [dbo].[Product_SpecificationAttribute_Mapping] ([AllowFiltering] ASC) INCLUDE ([ProductId], [SpecificationAttributeOptionId])
The error was The operation failed because an index or statistics with name 'IX_PSAM_AllowFiltering' already exists on table 'dbo.Product_SpecificationAttribute_Mapping'.
'
3 years ago
neo302 wrote:
Hello

This is regarding the update version 2020-06-10

I'm updating my code to the latest in dev and keep crashing on it trying to add the same index that already exists in my existing database.   This is happening across multiple indexes.  It seems there should be an additional check in the fluent code to check if the index already exists.  

What is the best way to get past this?

: 'An error occured executing the following sql:
CREATE INDEX [IX_PSAM_AllowFiltering] ON [dbo].[Product_SpecificationAttribute_Mapping] ([AllowFiltering] ASC) INCLUDE ([ProductId], [SpecificationAttributeOptionId])
The error was The operation failed because an index or statistics with name 'IX_PSAM_AllowFiltering' already exists on table 'dbo.Product_SpecificationAttribute_Mapping'.
'


I'm getting this on the FacebookPixelConfiguration  table as well.  It is trying to get created even though it exists.
3 years ago
neo302 wrote:
Hello

This is regarding the update version 2020-06-10

I'm updating my code to the latest in dev and keep crashing on it trying to add the same index that already exists in my existing database.   This is happening across multiple indexes.  It seems there should be an additional check in the fluent code to check if the index already exists.  

What is the best way to get past this?

: 'An error occured executing the following sql:
CREATE INDEX [IX_PSAM_AllowFiltering] ON [dbo].[Product_SpecificationAttribute_Mapping] ([AllowFiltering] ASC) INCLUDE ([ProductId], [SpecificationAttributeOptionId])
The error was The operation failed because an index or statistics with name 'IX_PSAM_AllowFiltering' already exists on table 'dbo.Product_SpecificationAttribute_Mapping'.
'

I'm getting this on the FacebookPixelConfiguration  table as well.  It is trying to get created even though it exists.


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Fixed by running the database upgrade script which updated the times in the MigrationVersionInfo table.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.