$isAlterIndex = (
(
isInString('INDEX', $sql)
- ) && (
+ ) || (
isInString('KEY', $sql)
- ) && (
+ ) || (
isInString('FULLTEXT', $sql)
- ) && (
+ ) || (
isInString('UNIQUE', $sql)
)
);
// Is a table column there?
function isSqlTableColumnFound ($tableName, $columnName) {
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ',columnName=' . $columName . ' - ENTERED!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ',columnName=' . $columnName . ' - ENTERED!');
// Do we have cache?
if (!isset($GLOBALS[__FUNCTION__][$tableName][$columnName])) {
// And column name as well
} // END - if
// Return cache
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ',columnName=' . $columName . ',result=' . intval($GLOBALS[__FUNCTION__][$tableName][$columnName]) . ' - EXIT!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ',columnName=' . $columnName . ',result=' . intval($GLOBALS[__FUNCTION__][$tableName][$columnName]) . ' - EXIT!');
return $GLOBALS[__FUNCTION__][$tableName][$columnName];
}
`coupon_code` VARCHAR(30) NULL DEFAULT NULL,
`cashed_on` TIMESTAMP NULL DEFAULT NULL,
PRIMARY KEY (`id`),
-UNIQUE `coupon_user` (`coupon_id`,`userid`),
+UNIQUE INDEX `coupon_user` (`coupon_id`,`userid`),
UNIQUE (`coupon_code`)",
'Coupon->user connection');
`earning_provider` VARCHAR(255) NOT NULL DEFAULT 'INVALID',
`earning_sorting` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`earning_id`),
-UNIQUE `earning_group_name` (`earning_group`,`earning_provider`)",
+UNIQUE INDEX `earning_group_name` (`earning_group`,`earning_provider`)",
'Registered (extra) earnings');
// User->earnings connection table
`earning_current_amount` SMALLINT(7) NOT NULL DEFAULT 0,
`earning_points` FLOAT(20,5) NOT NULL DEFAULT 0.00000,
PRIMARY KEY (`id`),
-UNIQUE `user_earning` (`earning_id`,`earning_userid`),
+UNIQUE INDEX `user_earning` (`earning_id`,`earning_userid`),
INDEX (`earning_userid`)",
'User->Earning connections');
`grade_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`grade_cash_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
-UNIQUE `grade_cash` (`grade_id`,`grade_cash_id`),
+UNIQUE INDEX `grade_cash` (`grade_id`,`grade_cash_id`),
INDEX (`grade_cash_id`)",
'Grade<->cash data connection');
`network_type_click_url` VARCHAR(255) NOT NULL DEFAULT '',
`network_type_banner_url` VARCHAR(255) NULL DEFAULT NULL,
PRIMARY KEY (`network_type_id`),
-UNIQUE `provider_type` (`network_id`,`network_type_handle`)",
+UNIQUE INDEX `provider_type` (`network_id`,`network_type_handle`)",
'Types provideable by networks');
// HTTP parameters (names) for URLs
`request_param_value` VARCHAR(20) NOT NULL DEFAULT 'invalid',
`request_param_default` VARCHAR(255) NULL DEFAULT NULL,
PRIMARY KEY (`network_param_id`),
-UNIQUE `provider_type_key` (`network_id`,`network_type_id`,`request_param_key`),
-UNIQUE `provider_type_value` (`network_id`,`network_type_id`,`request_param_value`),",
+UNIQUE INDEX `provider_type_key` (`network_id`,`network_type_id`,`request_param_key`),
+UNIQUE INDEX `provider_type_value` (`network_id`,`network_type_id`,`request_param_value`),",
'Request parameters for GET/POST request');
// Error status codes
`network_type_code_value` VARCHAR(50) NOT NULL DEFAULT '',
`network_type_code_type` VARCHAR(100) NOT NULL DEFAULT 'INVALID_TYPE',
PRIMARY KEY (`network_type_code_id`),
-UNIQUE `code_type` (`network_type_code_value`,`network_type_id`),
+UNIQUE INDEX `code_type` (`network_type_code_value`,`network_type_id`),
INDEX (`network_type_id`)",
'Error codes for all types');
`network_api_index` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0,
`sort` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`network_api_id`),
-UNIQUE `provider_type_key` (`network_id`,`network_type_id`,`network_api_index`),
+UNIQUE INDEX `provider_type_key` (`network_id`,`network_type_id`,`network_api_index`),
INDEX (`sort`)",
'Translation of API responses, generic data, DO NOT ALTER!');
`network_query_amount` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`network_active` ENUM('Y','N') NOT NULL DEFAULT 'Y',
PRIMARY KEY (`network_id`),
-UNIQUE `network_affiliate` (`network_id`,`network_affiliate_id`),
-UNIQUE `affiliate_site` (`network_affiliate_id`,`network_site_id`)",
+UNIQUE INDEX `network_affiliate` (`network_id`,`network_affiliate_id`),
+UNIQUE INDEX `affiliate_site` (`network_affiliate_id`,`network_site_id`)",
'Configuration data from the webmaster (you!)');
// Configuration data for e.g. reload-time
`min_payment` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
`allow_erotic` VARCHAR(10) NOT NULL DEFAULT '',
PRIMARY KEY (`network_data_id`),
-UNIQUE `provider_type` (`network_id`,`network_type_id`)",
+UNIQUE INDEX `provider_type` (`network_id`,`network_type_id`)",
'Configuration data for every type (e.g. reload-time)');
// Cache for queried APIs. Re-check depends on config
`network_cache_data` MEDIUMBLOB,
`network_cache_timestamp` TIMESTAMP NULL DEFAULT NULL,
PRIMARY KEY (`network_cache_id`),
-UNIQUE `provider_type` (`network_id`,`network_type_id`)",
+UNIQUE INDEX `provider_type` (`network_id`,`network_type_id`)",
'Cache for all queried APIs');
// Reload locks for several types
`network_reload_lock` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0,
`network_inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`network_reload_id`),
-UNIQUE `provider_type` (`network_id`,`network_type_id`)",
+UNIQUE INDEX `provider_type` (`network_id`,`network_type_id`)",
'Reload locks');
// Insert API response array translations, these will be used for calling the right filter function
`nl_order_placed` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`nl_order_accepted` ENUM('Y','N') NOT NULL DEFAULT 'N',
PRIMARY KEY (`nl_order_id`),
-UNIQUE `sponsor_nl_topic` (`nl_sponsor_id`,`nl_id`,`nl_topic_id`),
+UNIQUE INDEX `sponsor_nl_topic` (`nl_sponsor_id`,`nl_id`,`nl_topic_id`),
INDEX `topic` (`nl_topic_id`)",
'Newsletter orders');
`active` ENUM('Y','N') NOT NULL DEFAULT 'N',
`sort` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
-UNIQUE `action_what` (`action`,`what`),
+UNIQUE INDEX `action_what` (`action`,`what`),
UNIQUE (`what`),
INDEX (`action`)",
'Sponsor menu');
break;
case '0.3.1': // SQL queries for v0.3.1
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_extensions` ADD UNIQUE `ext_name` (`ext_name`)");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` ADD UNIQUE `login` (`login`)");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_extensions` ADD UNIQUE INDEX `ext_name` (`ext_name`)");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` ADD UNIQUE INDEX `login` (`login`)");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_refbanner` ADD INDEX `visible` (`visible`)");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_refdepths` ADD UNIQUE `level` (`level`)");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_refdepths` ADD UNIQUE INDEX `level` (`level`)");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` ADD INDEX `level` (`level`)");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_pool` ADD INDEX `data_type` (`data_type`)");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_mod_reg` ADD UNIQUE `module` (`module`)");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_mod_reg` ADD UNIQUE INDEX `module` (`module`)");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admin_menu` ADD INDEX `action` (`action`)");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admin_menu` ADD INDEX `what` (`what`)");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_task_system` ADD INDEX `task_type` (`task_type`)");
case '0.5.0': // SQL queries for v0.5.0
addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` DROP INDEX `level`');
addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` DROP INDEX `userid`');
- addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` ADD UNIQUE `userid_level` (`userid`,`level`)');
+ addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` ADD UNIQUE INDEX `userid_level` (`userid`,`level`)');
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Referal-System unterstützt nun detailierte Referal-Übersicht und vieles mehr.");
`filter_active` ENUM('N','Y') NOT NULL DEFAULT 'Y',
`filter_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`filter_id`),
-UNIQUE `name_function` (`filter_name` , `filter_function`)",
+UNIQUE INDEX `name_function` (`filter_name` , `filter_function`)",
'Filter system');
// Admin menu
`url_reject_reason` VARCHAR(255) NOT NULL DEFAULT '',
`url_fixed_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`url_id`),
-UNIQUE `userid_url` (`url_userid`,`url`),
+UNIQUE INDEX `userid_url` (`url_userid`,`url`),
INDEX `status_userid` (`url_status`,`url_userid`)",
'Visitor add-on URLs');
`locks_url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`locks_last_surfed` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`locks_id`),
-UNIQUE `userid_url` (`locks_userid`,`locks_url_id`),
+UNIQUE INDEX `userid_url` (`locks_userid`,`locks_url_id`),
INDEX (`locks_url_id`)",
'Vistor-addon reload locks');
`salts_url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`salts_last_salt` VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (`salts_id`),
-UNIQUE `salts_userid_url` (`salts_userid`,`salts_url_id`),
+UNIQUE INDEX `salts_userid_url` (`salts_userid`,`salts_url_id`),
INDEX (`salts_url_id`)",
'Visitor add-on last used salts');
`stats_count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`stats_last_surfed` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`stats_id`),
-UNIQUE `userid_url` (`stats_userid`,`stats_url_id`),
+UNIQUE INDEX `userid_url` (`stats_userid`,`stats_url_id`),
INDEX (`stats_url_id`)",
'Visitor add-on Statistics');
`actions_action` ENUM('EDIT','DELETE','PAUSE','UNPAUSE','FRAMETEST','RETREAT','RESUBMIT','BOOKNOW') NULL DEFAULT NULL,
`actions_new_status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NULL DEFAULT NULL,
PRIMARY KEY (`actions_id`),
-UNIQUE `status_action` (`actions_status`,`actions_action`)",
+UNIQUE INDEX `status_action` (`actions_status`,`actions_action`)",
'Visitor add-on Member Actions');
// Member actions
case '0.3.6': // SQL queries for v0.3.6
addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` DROP INDEX `userid`');
- addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` ADD UNIQUE `userid_catid` (`userid` , `cat_id`)');
+ addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` ADD UNIQUE INDEX `userid_catid` (`userid` , `cat_id`)');
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Der Sperrgrund wird nun mit abgespeichert und beim Löschen des Users mit ausgesendet.");
`level` smallINT(6) UNSIGNED NOT NULL DEFAULT 0,
`refid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
-UNIQUE `user_refid` (`userid`,`level`,`refid`),
+UNIQUE INDEX `user_refid` (`userid`,`level`,`refid`),
INDEX (`level`),
INDEX (`refid`)",
'User referals');
`y_reload` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 0,
`inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
-UNIQUE `y_type` (`type`,`y_id`)",
+UNIQUE INDEX `y_type` (`type`,`y_id`)",
'Reload lock reminder for Yoo!Media campaigns');
break;
if (($active == 'Y') || ($active == 'A') || ((in_array($filterName, array('shutdown','extension_remove','post_extension_run_sql'))) && ($active == 'R'))) {
// Is this filter there?
if (!function_exists($filterFunction)) {
+ // Should be logged
+ logDebugMessage(__FUNCTION__, __LINE__, 'filterName=' . $filterName . ',filterFunction=' . $filterFunction . ' - AUTO-UNREGISTERED!');
+
// Unregister it
unregisterFilter(__FUNCTION__, __LINE__, $filterName, $filterFunction);
// Is the extension ext-sql_patches updated?
if ((!isExtensionInstalled('sql_patches')) || (isExtensionInstalledAndOlder('sql_patches', '0.5.9'))) {
+ // Log only in debug mode
+ if (isDebugModeEnabled()) {
+ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot flush filters, sql_patches might be missing. isExtensionInstalled()=' . intval(isExtensionInstalled('sql_patches')) . ',isExtensionInstalledAndOlder()=' . intval(isExtensionInstalledAndOlder('sql_patches', '0.5.9')));
+ } // END - if
+
// Abort silently here
- logDebugMessage(__FUNCTION__, __LINE__, 'Cannot flush filters, sql_patches might be missing. isExtensionInstalled()=' . isExtensionInstalled('sql_patches') . ',isExtensionInstalledAndOlder()=' . isExtensionInstalledAndOlder('sql_patches', '0.5.9'));
return false;
} // END - if
// Now insert our unqiue key
addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_filters` DROP KEY `name_function`');
-addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_filters` ADD UNIQUE `name_function` (`filter_name` , `filter_function`)');
+addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_filters` ADD UNIQUE INDEX `name_function` (`filter_name` , `filter_function`)');
// [EOF]
?>
// Now insert our unqiue key for action-what combination
addSql(sprintf("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` DROP KEY `action_what`", $menu));
- addSql(sprintf("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE `action_what` (`action` , `what`)", $menu));
+ addSql(sprintf("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE INDEX `action_what` (`action` , `what`)", $menu));
// Now insert our unqiue key for what
addSql(sprintf("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` DROP KEY `what`", $menu));
- addSql(sprintf("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE `what` (`what`)", $menu));
+ addSql(sprintf("ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE INDEX `what` (`what`)", $menu));
// And run all
runFilterChain('run_sqls');
SQL_QUERY('UPDATE `{?_MYSQL_PREFIX?}_refsystem` SET `level`=`level`+1', __FILE__, __LINE__);
// Add it again
- SQL_ALTER_TABLE('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` ADD UNIQUE `userid_level` (`userid`,`level`)', __FILE__, __LINE__);
+ SQL_ALTER_TABLE('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` ADD UNIQUE INDEX `userid_level` (`userid`,`level`)', __FILE__, __LINE__);
// Rebuild cache
rebuildCache('refsystem', 'refsystem');