-- knifeban_web.KbRestrict_CurrentBans definition

CREATE TABLE `KbRestrict_CurrentBans` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `client_name` varchar(64) NOT NULL,
  `client_steamid` varchar(64) NOT NULL,
  `client_ip` varchar(64) NOT NULL,
  `admin_name` varchar(64) NOT NULL,
  `admin_steamid` varchar(64) NOT NULL,
  `reason` varchar(255) NOT NULL,
  `map` varchar(64) NOT NULL,
  `length` int(11) NOT NULL,
  `time_stamp_start` datetime DEFAULT current_timestamp(),
  `time_played_start` int(11) NOT NULL,
  `time_played_end` int(11) NOT NULL,
  `is_expired` int(11) NOT NULL,
  `is_removed` int(11) NOT NULL,
  `time_stamp_removed` int(20) NOT NULL,
  `admin_name_removed` varchar(255) NOT NULL,
  `admin_steamid_removed` varchar(255) NOT NULL,
  `reason_removed` varchar(255) NOT NULL,
  `web_unban_required` tinyint(1) NOT NULL DEFAULT 0,
  `web_addban_required` tinyint(1) NOT NULL DEFAULT 0,
  `web_ban_delete` tinyint(1) NOT NULL DEFAULT 0,
  `web_edit_required` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `idx_steamid_search` (`client_steamid`),
  KEY `idx_ip_search` (`client_ip`),
  KEY `idx_admin_steamid` (`admin_steamid`),
  KEY `idx_status` (`is_expired`,`is_removed`),
  KEY `idx_steamid_ip_status` (`client_steamid`,`client_ip`,`is_expired`,`is_removed`),
  KEY `idx_web_unban_required` (`web_unban_required`),
  KEY `idx_web_addban_required` (`web_addban_required`),
  KEY `idx_web_ban_delete` (`web_ban_delete`),
  KEY `idx_web_edit_required` (`web_edit_required`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE IF NOT EXISTS knifeban_web.KbRestrict_weblogs (
										`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
										`message` varchar(200) NOT NULL,
										`admin_name` varchar(255) NOT NULL,
										`admin_steamid` varchar(64) NOT NULL,
										`client_name` varchar(255) NOT NULL,
										`client_steamid` varchar(64) NOT NULL,
										`time_stamp` int(20) NOT NULL,
										PRIMARY KEY(`id`));
