/*M!999999\- enable the sandbox mode */ 
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `alerts` (
  `alert_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `url_id` int(10) unsigned DEFAULT NULL,
  `alert` varchar(200) NOT NULL,
  `level` smallint(6) NOT NULL,
  `workerid` tinyint(3) unsigned NOT NULL,
  `cas` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`alert_id`),
  KEY `url_id` (`url_id`),
  CONSTRAINT `alerts_ibfk_1` FOREIGN KEY (`url_id`) REFERENCES `url` (`url_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `cache` (
  `url_id` int(10) unsigned NOT NULL,
  `data` longtext NOT NULL,
  `vytvoreno` timestamp NOT NULL DEFAULT current_timestamp(),
  `smazat` date NOT NULL DEFAULT '2100-01-01',
  PRIMARY KEY (`url_id`),
  KEY `smazat` (`smazat`),
  KEY `vytvoreno` (`vytvoreno`),
  CONSTRAINT `cache_ibfk_1` FOREIGN KEY (`url_id`) REFERENCES `url` (`url_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `emails` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `text` text NOT NULL,
  `odeslano` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `results` (
  `url_id` int(10) unsigned NOT NULL,
  `data` blob NOT NULL,
  PRIMARY KEY (`url_id`),
  CONSTRAINT `results_ibfk_1` FOREIGN KEY (`url_id`) REFERENCES `url` (`url_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `sys` (
  `id` varchar(100) NOT NULL,
  `value` varchar(200) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `url` (
  `url_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `url` varchar(400) NOT NULL,
  `priority` tinyint(3) unsigned NOT NULL DEFAULT 100,
  `workerid` tinyint(3) unsigned DEFAULT NULL,
  `changed` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `source` varchar(100) NOT NULL,
  `source_engine` enum('firmy','azet') DEFAULT NULL,
  `state` varchar(20) NOT NULL DEFAULT 'new',
  `remoteid_int` int(10) unsigned DEFAULT NULL,
  `remoteid_char` varchar(20) DEFAULT NULL,
  `orig_change` timestamp NULL DEFAULT NULL,
  `created` timestamp NULL DEFAULT NULL,
  `saved` timestamp NULL DEFAULT NULL,
  `redirect_to` int(11) unsigned DEFAULT NULL,
  `centrala_url_id` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`url_id`),
  UNIQUE KEY `url` (`url`),
  KEY `changed` (`changed`),
  KEY `redirect_to` (`redirect_to`),
  KEY `remoteid_int` (`remoteid_int`),
  KEY `source_engine` (`source_engine`),
  KEY `priority` (`priority`),
  KEY `state` (`state`),
  KEY `vyber` (`source_engine`,`state`,`priority`),
  KEY `remoteid_char` (`remoteid_char`),
  KEY `source` (`source`(1)),
  CONSTRAINT `url_ibfk_1` FOREIGN KEY (`redirect_to`) REFERENCES `url` (`url_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `url_refresh-azet` (
  `url_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`url_id`),
  CONSTRAINT `url_refresh-azet_ibfk_1` FOREIGN KEY (`url_id`) REFERENCES `url` (`url_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `url_refresh-firmy` (
  `url_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`url_id`),
  CONSTRAINT `url_refresh-firmy_ibfk_1` FOREIGN KEY (`url_id`) REFERENCES `url` (`url_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `url_refresh-firmy_ibfk_2` FOREIGN KEY (`url_id`) REFERENCES `url` (`url_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `workers` (
  `workerid` tinyint(3) unsigned NOT NULL,
  `nazev` varchar(100) NOT NULL DEFAULT '',
  `state` varchar(100) NOT NULL DEFAULT 'on',
  `last_update` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `ip` int(10) unsigned DEFAULT NULL,
  `last_msg` varchar(250) NOT NULL DEFAULT '',
  `webget_today` int(10) unsigned NOT NULL DEFAULT 0,
  `webget_overall` int(10) unsigned NOT NULL DEFAULT 0,
  `grabbed_today` int(10) unsigned NOT NULL DEFAULT 0,
  `grabbed_overall` int(10) unsigned NOT NULL DEFAULT 0,
  PRIMARY KEY (`workerid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `workers_stats` (
  `workerid` tinyint(3) unsigned NOT NULL,
  `datum` datetime NOT NULL,
  `grabbed` int(10) unsigned NOT NULL DEFAULT 0,
  `webget` int(10) unsigned NOT NULL DEFAULT 0,
  PRIMARY KEY (`workerid`,`datum`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED;
/*!40101 SET character_set_client = @saved_cs_client */;
