SHARE
TWEET

Untitled

a guest Apr 18th, 2019 149 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DROP TABLE IF EXISTS `groups`;
  2.  
  3. #
  4. # Table structure for table 'groups'
  5. #
  6.  
  7. CREATE TABLE `groups` (
  8.   `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  9.   `name` varchar(20) NOT NULL,
  10.   `description` varchar(100) NOT NULL,
  11.   PRIMARY KEY (`id`)
  12. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  13.  
  14. #
  15. # Dumping data for table 'groups'
  16. #
  17.  
  18. INSERT INTO `groups` (`id`, `name`, `description`) VALUES
  19.      (1,'admin','Administrator'),
  20.      (2,'members','User');
  21.  
  22.  
  23.  
  24. DROP TABLE IF EXISTS `users`;
  25.  
  26. #
  27. # Table structure for table 'users'
  28. #
  29.  
  30. CREATE TABLE `users` (
  31.   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  32.   `ip_address` varchar(45) NOT NULL,
  33.   `username` varchar(100) NULL,
  34.   `password` varchar(255) NOT NULL,
  35.   `email` varchar(254) NOT NULL,
  36.   `activation_selector` varchar(255) DEFAULT NULL,
  37.   `activation_code` varchar(255) DEFAULT NULL,
  38.   `forgotten_password_selector` varchar(255) DEFAULT NULL,
  39.   `forgotten_password_code` varchar(255) DEFAULT NULL,
  40.   `forgotten_password_time` int(11) unsigned DEFAULT NULL,
  41.   `remember_selector` varchar(255) DEFAULT NULL,
  42.   `remember_code` varchar(255) DEFAULT NULL,
  43.   `created_on` int(11) unsigned NOT NULL,
  44.   `last_login` int(11) unsigned DEFAULT NULL,
  45.   `active` tinyint(1) unsigned DEFAULT NULL,
  46.   `first_name` varchar(50) DEFAULT NULL,
  47.   `last_name` varchar(50) DEFAULT NULL,
  48.   `company` varchar(100) DEFAULT NULL,
  49.   `phone` varchar(20) DEFAULT NULL,
  50.   PRIMARY KEY (`id`),
  51.   CONSTRAINT `uc_email` UNIQUE (`email`),
  52.   CONSTRAINT `uc_activation_selector` UNIQUE (`activation_selector`),
  53.   CONSTRAINT `uc_forgotten_password_selector` UNIQUE (`forgotten_password_selector`),
  54.   CONSTRAINT `uc_remember_selector` UNIQUE (`remember_selector`)
  55. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  56.  
  57.  
  58. #
  59. # Dumping data for table 'users'
  60. #
  61.  
  62. INSERT INTO `users` (`id`, `ip_address`, `username`, `password`, `email`, `activation_code`, `forgotten_password_code`, `created_on`, `last_login`, `active`, `first_name`, `last_name`, `company`, `phone`) VALUES
  63.      ('1','127.0.0.1','administrator','$2y$08$2qZbp3RAEXohqTUi00ZaWcMA6uJOFicwNZa4oD6ZFXFek63MG.Daa','admin@admin.com','',NULL,'1268889823','1268889823','1', 'Admin','istrator','ADMIN','0');
  64.  
  65.  
  66. DROP TABLE IF EXISTS `meta_users`;
  67.  
  68. #
  69. # Table structure for table 'meta_users'
  70. #
  71.  
  72. CREATE TABLE `meta_users` (
  73.   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  74.   `user_id` int(11) unsigned NOT NULL COMMENT 'ID пользователя',
  75.   `category_interest` varchar(20) DEFAULT NULL COMMENT 'Что вас интересует',
  76.   `city_job_wishes` varchar(20) DEFAULT NULL COMMENT 'В каких городах вы хотели бы работать',
  77.   `sphere_interest` varchar(20) DEFAULT NULL COMMENT 'Какие сферы интересны',
  78.   `company_interest` varchar(20) DEFAULT NULL COMMENT 'Работа в каких компаниях интересна',
  79.   PRIMARY KEY (`id`)
  80. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  81.  
  82. DROP TABLE IF EXISTS `users_groups`;
  83.  
  84. #
  85. # Table structure for table 'users_groups'
  86. #
  87.  
  88. CREATE TABLE `users_groups` (
  89.   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  90.   `user_id` int(11) unsigned NOT NULL,
  91.   `group_id` mediumint(8) unsigned NOT NULL,
  92.   PRIMARY KEY (`id`),
  93.   KEY `fk_users_groups_users1_idx` (`user_id`),
  94.   KEY `fk_users_groups_groups1_idx` (`group_id`),
  95.   CONSTRAINT `uc_users_groups` UNIQUE (`user_id`, `group_id`),
  96.   CONSTRAINT `fk_users_groups_users1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
  97.   CONSTRAINT `fk_users_groups_groups1` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
  98. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  99.  
  100. INSERT INTO `users_groups` (`id`, `user_id`, `group_id`) VALUES
  101.      (1,1,1),
  102.      (2,1,2);
  103.  
  104.  
  105. DROP TABLE IF EXISTS `login_attempts`;
  106.  
  107. #
  108. # Table structure for table 'login_attempts'
  109. #
  110.  
  111. CREATE TABLE `login_attempts` (
  112.   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  113.   `ip_address` varchar(45) NOT NULL,
  114.   `login` varchar(100) NOT NULL,
  115.   `time` int(11) unsigned DEFAULT NULL,
  116.   PRIMARY KEY (`id`)
  117. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  118.  
  119. DROP TABLE IF EXISTS `category`;
  120.  
  121. #
  122. # Table structure for table 'category'
  123. #
  124.  
  125. CREATE TABLE `category` (
  126.   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  127.   `name` varchar(200) DEFAULT NULL,
  128.   PRIMARY KEY (`id`)
  129. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  130.  
  131. DROP TABLE IF EXISTS `company`;
  132.  
  133. #
  134. # Table structure for table 'company'
  135. #
  136.  
  137. CREATE TABLE `company` (
  138.   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  139.   `name` varchar(200) DEFAULT NULL,
  140.   `logo` varchar(20) DEFAULT NULL,
  141.   PRIMARY KEY (`id`)
  142. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  143.  
  144. DROP TABLE IF EXISTS `city`;
  145.  
  146. #
  147. # Table structure for table 'city'
  148. #
  149.  
  150. CREATE TABLE `city` (
  151.   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  152.   `name` varchar(200) DEFAULT NULL,
  153.   PRIMARY KEY (`id`)
  154. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  155.  
  156. DROP TABLE IF EXISTS `sphere`;
  157.  
  158. #
  159. # Table structure for table 'sphere'
  160. #
  161.  
  162. CREATE TABLE `sphere` (
  163.   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  164.   `name` varchar(200) DEFAULT NULL,
  165.   PRIMARY KEY (`id`)
  166. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  167.  
  168. DROP TABLE IF EXISTS `events`;
  169.  
  170. #
  171. # Table structure for table 'events'
  172. #
  173.  
  174. CREATE TABLE IF NOT EXISTS `events` (
  175.   `id` int(11) NOT NULL AUTO_INCREMENT,
  176.   `category` int(11) unsigned NOT NULL COMMENT 'Категория',
  177.   `name` text NOT NULL COMMENT 'Наименование',
  178.   `company` int(11) unsigned NOT NULL COMMENT 'Компания',
  179.   `city` int(11) unsigned NOT NULL COMMENT'Город',
  180.   `request_start` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Подача заявок c',
  181.   `request_end` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Подача заявок до',
  182.   `event_start` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Провед-е с',
  183.   `event_end` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Провед-е до',
  184.   `sphere` int(11) unsigned NOT NULL COMMENT 'сфера',
  185.   `additional` text NOT NULL DEFAULT '' COMMENT 'Дополнительное поле',
  186.   PRIMARY KEY (`id`),
  187.   UNIQUE KEY `id` (`id`)
  188. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top