// Also store proxy address
[
- 'ALTER TABLE `ctracker_data` ADD `proxy_addr` VARCHAR(15) NULL DEFAULT NULL AFTER `remote_addr`',
- 'ALTER TABLE `ctracker_ticket` ADD `ctracker_ticket_proxy_addr` VARCHAR(15) NULL DEFAULT NULL',
+ "ALTER TABLE `ctracker_data` ADD `proxy_addr` VARCHAR(15) NULL DEFAULT NULL AFTER `remote_addr`",
+ "ALTER TABLE `ctracker_ticket` ADD `ctracker_ticket_proxy_addr` VARCHAR(15) NULL DEFAULT NULL",
],
// Better key for always repeating query
[
- 'ALTER TABLE `ctracker_data` ADD INDEX `remote_proxy_last` ( `remote_addr`, `proxy_addr`, `last_attempt` DESC )',
+ "ALTER TABLE `ctracker_data` ADD INDEX `remote_proxy_last` ( `remote_addr`, `proxy_addr`, `last_attempt` DESC )",
],
// HTTP request method
// Index on count
[
- 'ALTER TABLE `ctracker_data` ADD INDEX `count` (`count`)',
+ "ALTER TABLE `ctracker_data` ADD INDEX `count` (`count`)",
],
// Log also UA after check
[
- "ALTER TABLE `ctracker_data`
- ADD `check_ua` tinytext COLLATE 'utf8_general_ci' NULL COMMENT 'User agent after check' AFTER `post_data`,
- CHANGE `check_worm` `check_get` tinytext COLLATE 'utf8_general_ci' NOT NULL COMMENT 'GET data after check' AFTER `check_ua`,
- CHANGE `check_post` `check_post` tinytext COLLATE 'utf8_general_ci' NOT NULL COMMENT 'POST data after check' AFTER `check_worm`",
+ "ALTER TABLE `ctracker_data` ADD `check_ua` tinytext COLLATE 'utf8_general_ci' NULL COMMENT 'User agent after check' AFTER `post_data`",
+ "ALTER TABLE `ctracker_data` CHANGE `check_worm` `check_get` tinytext COLLATE 'utf8_general_ci' NOT NULL COMMENT 'GET data after check' AFTER `check_ua`",
+ "ALTER TABLE `ctracker_data` CHANGE `check_post` `check_post` tinytext COLLATE 'utf8_general_ci' NOT NULL COMMENT 'POST data after check' AFTER `check_get`",
],
// View for request methods
[
- 'CREATE VIEW `view_most_request_methods` AS
+ "CREATE VIEW `view_most_request_methods` AS
SELECT SQL_CALC_FOUND_ROWS COUNT(`id`) AS `total_rows`, `request_method`
FROM `ctracker_data`
- GROUP BY `request_method`'
+ GROUP BY `request_method`"
],
// Anti-spambot field
"ALTER TABLE `ctracker_data` CHANGE `user_agent` `user_agent` tinytext COLLATE 'utf8_general_ci' NOT NULL COMMENT 'User agent string' AFTER `remote_addr`",
"ALTER TABLE `ctracker_data` CHANGE `get_data` `get_data` tinytext COLLATE 'utf8_general_ci' NOT NULL COMMENT 'Serialized GET data' AFTER `user_agent`",
"ALTER TABLE `ctracker_data` CHANGE `post_data` `post_data` tinytext COLLATE 'utf8_general_ci' NOT NULL COMMENT 'Serialized POST data' AFTER `get_data`",
- "ALTER TABLE `ctracker_data` CHANGE `check_worm` `check_worm` tinytext COLLATE 'utf8_general_ci' NOT NULL COMMENT 'Manipulated GET data' AFTER `check_ua`",
- "ALTER TABLE `ctracker_data` CHANGE `check_post` `check_post` tinytext COLLATE 'utf8_general_ci' NOT NULL COMMENT 'Manipulated GET data' AFTER `check_worm`",
+ "ALTER TABLE `ctracker_data` CHANGE `check_get` `check_get` tinytext COLLATE 'utf8_general_ci' NOT NULL COMMENT 'Manipulated GET data' AFTER `check_ua`",
+ "ALTER TABLE `ctracker_data` CHANGE `check_post` `check_post` tinytext COLLATE 'utf8_general_ci' NOT NULL COMMENT 'Manipulated GET data' AFTER `check_get`",
"ALTER TABLE `ctracker_data` CHANGE `referer` `referer` varchar(255) COLLATE 'utf8_general_ci' NOT NULL COMMENT 'Referer' AFTER `script_name`",
"ALTER TABLE `ctracker_data` CHANGE `request_method` `request_method` varchar(255) COLLATE 'utf8_general_ci' NULL COMMENT 'HTTP request method' AFTER `referer`",
"ALTER TABLE `ctracker_data` CHANGE `proxy_used` `proxy_used` enum('Y','N') COLLATE 'utf8_general_ci' NOT NULL DEFAULT 'N' COMMENT 'Proxy used?' AFTER `request_method`",
"ALTER TABLE `ctracker_data` CHANGE `proxy_addr` `proxy_addr` varchar(15) COLLATE 'utf8_general_ci' NULL COMMENT 'Detected proxy address' AFTER `count`",
"ALTER TABLE `ctracker_data` COLLATE 'utf8_general_ci'",
],
+
+ // Tzop fixed
+ [
+ "ALTER TABLE `ctracker_data` CHANGE `spam_bot_dectections` `spam_bot_detections` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'Spam-bot attempts'",
+ ],
];
}