$SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_urls`";
$SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_urls` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`url` VARCHAR(255) NOT NULL DEFAULT '',
`last_salt` VARCHAR(255) NOT NULL DEFAULT '',
-`views_total` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
-`views_max` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
-`views_allowed` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+`views_total` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`views_max` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`views_allowed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NOT NULL DEFAULT 'PENDING',
`registered` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_locked` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
`lock_reason` VARCHAR(255) NOT NULL DEFAULT '',
`reject_reason` VARCHAR(255) NOT NULL DEFAULT '',
+`fixed_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY(`id`),
UNIQUE KEY `userid_url` (`userid`,`url`),
INDEX `status_userid` (`status`,`userid`),
$SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_locks`";
$SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_locks` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
-`url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`last_surfed` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(`id`),
-INDEX (`userid`),
+UNIQUE KEY `userid_url` (`userid`,`url_id`),
INDEX (`url_id`)
) TYPE=MyISAM COMMENT='Surfbar reload locks'";
$SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_salts`";
$SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_salts` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
-`url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`last_salt` VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY(`id`),
-INDEX (`userid`),
+UNIQUE KEY `userid_url` (`userid`,`url_id`),
INDEX (`url_id`)
) TYPE=MyISAM COMMENT='Surfbar last used salts'";
`count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`last_online` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
-INDEX (`userid`,`url_id`)
+UNIQUE KEY `userid_url` (`userid`,`url_id`),
+INDEX (`url_id`)
) TYPE=MyISAM COMMENT='Surfbar Statistics'";
// Member actions pending on status
$SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_actions`";
$SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_actions` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NOT NULL DEFAULT 'PENDING',
+`status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NULL DEFAULT NULL,
`action` ENUM('EDIT','DELETE','PAUSE','UNPAUSE','FRAMETEST','RETREAT','RESUBMIT','BOOKNOW') NULL DEFAULT NULL,
`new_status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NULL DEFAULT NULL,
PRIMARY KEY (`id`),
-INDEX (`status`)
+UNIQUE KEY `status_action` (`status`,`action`)
) TYPE=MyISAM COMMENT='Surfbar Member Actions'";
// Member actions