-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Апр 18 2015 г., 02:34
-- Версия сервера: 5.5.41-0ubuntu0.14.04.1-log
-- Версия PHP: 5.5.23-1+deb.sury.org~trusty+2

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- База данных: `phrack_loader`
--

-- --------------------------------------------------------

--
-- Структура таблицы `bots`
--

CREATE TABLE IF NOT EXISTS `bots` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `guid` varchar(16) NOT NULL,
  `ip` varchar(15) NOT NULL,
  `country` varchar(2) DEFAULT NULL,
  `bits` int(11) NOT NULL DEFAULT '32',
  `pl` tinyint(1) NOT NULL,
  `os` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `last_visit_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `guid` (`guid`),
  KEY `country` (`country`,`bits`,`pl`,`os`),
  KEY `last_visit_at` (`last_visit_at`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=54 ;

-- --------------------------------------------------------

--
-- Структура таблицы `tasks`
--

CREATE TABLE IF NOT EXISTS `tasks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(15) NOT NULL,
  `type` enum('local','remote') NOT NULL DEFAULT 'local',
  `pl` tinyint(1) DEFAULT NULL,
  `countries` varchar(2048) NOT NULL,
  `countries_inverse` tinyint(1) NOT NULL,
  `local_file` varchar(255) DEFAULT NULL,
  `remote_file` varchar(512) DEFAULT NULL,
  `limit` int(11) NOT NULL,
  `load` int(11) NOT NULL,
  `exec` int(11) NOT NULL,
  `update_remote_fraq` int(11) DEFAULT NULL,
  `last_update_remote_at` datetime NOT NULL,
  `created_at` datetime NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;

-- --------------------------------------------------------

--
-- Структура таблицы `tasks_bots`
--

CREATE TABLE IF NOT EXISTS `tasks_bots` (
  `task_id` int(11) NOT NULL,
  `bot_guid` varchar(16) NOT NULL,
  `exec` tinyint(1) NOT NULL DEFAULT '0',
  KEY `bot_guid` (`bot_guid`),
  KEY `task_id` (`task_id`,`exec`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Структура таблицы `task_logs`
--

CREATE TABLE IF NOT EXISTS `task_logs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `log` varchar(512) NOT NULL,
  `task_id` int(11) NOT NULL,
  `error` tinyint(4) NOT NULL DEFAULT '0',
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
