Symptoms

When you run the installer for v6.0 to upgrade from v5.4.0.4, the installation fails with the following error message:

Table or indexed view 'TST_ATTACHMENT' does not have a full-text index or user does not have permission to perform this action.

When you look in the installation log file you will see more detailed information logged:

While executing SQL command:
>>>  IF EXISTS (SELECT * FROM sysfulltextcatalogs ftc WHERE ftc.name = N'FT_ARTIFACTS')  BEGIN      DROP FULLTEXT INDEX ON TST_ATTACHMENT;  END  
<<<
Messages:
   Table or indexed view 'TST_ATTACHMENT' does not have a full-text index or user does not have permission to perform this action. [System.Data.SqlClient.SqlException]

SQL Messages:
   1: Table or indexed view 'TST_ATTACHMENT' does not have a full-text index or user does not have permission to perform this action.

This error often happens when you have the database set to have free text indexes and the freetext catalog exists, but some of the individual indexes is missing.

Solution

The solution is to run the following SQL command to delete all the existing freetext indexes and catalogs and let the installer create them from scratch:

IF EXISTS (SELECT * FROM sysfulltextcatalogs ftc WHERE ftc.name = N'FT_ARTIFACTS')
BEGIN
    DROP FULLTEXT INDEX ON TST_REQUIREMENT;
    DROP FULLTEXT INDEX ON TST_TEST_CASE;
    DROP FULLTEXT INDEX ON TST_INCIDENT;
    DROP FULLTEXT INDEX ON TST_RELEASE;
    DROP FULLTEXT INDEX ON TST_TEST_RUN;
    DROP FULLTEXT INDEX ON TST_TASK;
    DROP FULLTEXT INDEX ON TST_TEST_STEP;
    DROP FULLTEXT INDEX ON TST_TEST_SET;
    DROP FULLTEXT INDEX ON TST_AUTOMATION_HOST;
    DROP FULLTEXT INDEX ON TST_ATTACHMENT;
    DROP FULLTEXT INDEX ON TST_BUILD;
    DROP FULLTEXT INDEX ON TST_RISK;
    DROP FULLTEXT CATALOG [FT_ARTIFACTS];

END
GO

IF EXISTS (SELECT * FROM sysfulltextcatalogs ftc WHERE ftc.name = N'FT_COMMENTS')
BEGIN
    DROP FULLTEXT INDEX ON TST_REQUIREMENT_DISCUSSION;
    DROP FULLTEXT INDEX ON TST_RELEASE_DISCUSSION;
    DROP FULLTEXT INDEX ON TST_TASK_DISCUSSION;
    DROP FULLTEXT INDEX ON TST_TEST_CASE_DISCUSSION;
    DROP FULLTEXT INDEX ON TST_TEST_SET_DISCUSSION;
    DROP FULLTEXT INDEX ON TST_INCIDENT_RESOLUTION;
    DROP FULLTEXT INDEX ON TST_RISK_DISCUSSION;
    DROP FULLTEXT CATALOG [FT_COMMENTS];
END
GO