protected function getIndexSqlDefinition($tableName, $indexName, $indexSpec)
    {

        // Determine index name
        $index = $this->buildMSSQLIndexName($tableName, $indexName);

        // Consolidate/Cleanup spec into array format
        $indexSpec = $this->parseIndexSpec($indexName, $indexSpec);

        $drop = "IF EXISTS (SELECT name FROM sys.indexes WHERE name = '$index' AND object_id = object_id(SCHEMA_NAME() + '.$tableName')) DROP INDEX $index ON \"$tableName\";";

        // create a type-specific index
        if ($indexSpec['type'] == 'fulltext') {
            if(!$this->database->fullTextEnabled()) {
                return '';
            }
            // enable fulltext on this table
            $this->createFullTextCatalog();
            $primary_key = $this->getPrimaryKey($tableName);

            if ($primary_key) {
                return "$drop CREATE FULLTEXT INDEX ON \"$tableName\" ({$indexSpec['value']})"
                     . "KEY INDEX $primary_key WITH CHANGE_TRACKING AUTO;";
            }
        }

        if ($indexSpec['type'] == 'unique') {
            return "$drop CREATE UNIQUE INDEX $index ON \"$tableName\" ({$indexSpec['value']});";
        }

        return "$drop CREATE INDEX $index ON \"$tableName\" ({$indexSpec['value']});";
    }