+// Add ALTER TABLE `foo` ADD INDEX sql if not found
+function addExtensionAddTableIndexSql ($tableName, $indexName, $columnSql) {
+ // Is the column there?
+ if (!ifSqlTableIndexExist('{?_MYSQL_PREFIX?}_' . $tableName, $indexName, isInstallationPhase())) {
+ // Then add it
+ addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_' . $tableName . '` ADD INDEX `' . $indexName . '` ' . $columnSql);
+ } elseif (isDebugModeEnabled()) {
+ // Add debug line
+ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ',indexName=' . $indexName . ',columnSql=' . $columnSql . ': does already exist.');
+ }
+}
+
+// Add ALTER TABLE `foo` ADD UNIQUE INDEX sql if not found
+function addExtensionAddTableUniqueSql ($tableName, $indexName, $columnSql) {
+ // Is the column there?
+ if (!ifSqlTableIndexExist('{?_MYSQL_PREFIX?}_' . $tableName, $indexName, isInstallationPhase())) {
+ // Then add it
+ addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_' . $tableName . '` ADD UNIQUE INDEX `' . $indexName . '` ' . $columnSql);
+ } elseif (isDebugModeEnabled()) {
+ // Add debug line
+ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ',indexName=' . $indexName . ',columnSql=' . $columnSql . ': does already exist.');
+ }
+}
+
+// Add ALTER TABLE `foo` ADD FULLTEXT sql if not found
+function addExtensionAddTableFulltextSql ($tableName, $indexName, $columnSql) {
+ // Is the column there and MyISAM engine? (InnoDB doesn't support FULLTEXT)
+ if ((getTableType() == 'MyISAM') && (!ifSqlTableIndexExist('{?_MYSQL_PREFIX?}_' . $tableName, $indexName, isInstallationPhase()))) {
+ // Then add it
+ addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_' . $tableName . '` ADD FULLTEXT `' . $indexName . '` ' . $columnSql);
+ } elseif (isDebugModeEnabled()) {
+ // Add debug line
+ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ',indexName=' . $indexName . ',columnSql=' . $columnSql . ': does already exist.');
+ }
+}
+