· 9 years ago · Dec 14, 2016, 04:17 PM
1-- --------------------------------------------------------
2-- Servidor: 127.0.0.1
3-- Versão do servidor: 10.1.9-MariaDB-log - mariadb.org binary distribution
4-- OS do Servidor: Win32
5-- HeidiSQL Versão: 9.4.0.5125
6-- --------------------------------------------------------
7
8/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
9/*!40101 SET NAMES utf8 */;
10/*!50503 SET NAMES utf8mb4 */;
11/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
12/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
13
14-- Copiando estrutura para tabela l2kael.accounts
15DROP TABLE IF EXISTS `accounts`;
16CREATE TABLE IF NOT EXISTS `accounts` (
17 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
18 `fristname` varchar(20) NOT NULL,
19 `lastname` varchar(20) NOT NULL,
20 `login` varchar(45) NOT NULL,
21 `password` varchar(45) NOT NULL,
22 `email` varchar(45) NOT NULL,
23 `lastactive` decimal(20,0) DEFAULT NULL,
24 `access_level` int(11) NOT NULL DEFAULT '0',
25 `lastIP` varchar(15) DEFAULT NULL,
26 `lastServer` int(4) NOT NULL DEFAULT '1',
27 PRIMARY KEY (`id`),
28 UNIQUE KEY `login_UNIQUE` (`login`),
29 UNIQUE KEY `email_UNIQUE` (`email`)
30) ENGINE=InnoDB DEFAULT CHARSET=utf8;
31
32-- Copiando estrutura para tabela l2kael.categories
33DROP TABLE IF EXISTS `categories`;
34CREATE TABLE IF NOT EXISTS `categories` (
35 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
36 `title_en` varchar(50) NOT NULL,
37 `title_ptbr` varchar(50) NOT NULL,
38 `title_es` varchar(50) NOT NULL,
39 PRIMARY KEY (`id`)
40) ENGINE=InnoDB DEFAULT CHARSET=utf8;
41
42-- Copiando dados para a tabela l2kael.categories: ~0 rows (aproximadamente)
43/*!40000 ALTER TABLE `categories` DISABLE KEYS */;
44/*!40000 ALTER TABLE `categories` ENABLE KEYS */;
45
46-- Copiando estrutura para tabela l2kael.comments
47DROP TABLE IF EXISTS `comments`;
48CREATE TABLE IF NOT EXISTS `comments` (
49 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
50 `text` text NOT NULL,
51 `time` datetime NOT NULL,
52 `approved` tinyint(1) NOT NULL COMMENT 'Comments visible (approved) or not',
53 `noticies_id` int(10) unsigned NOT NULL,
54 `accounts_id` int(10) unsigned NOT NULL,
55 PRIMARY KEY (`id`),
56 KEY `fk_comments_noticies1_idx` (`noticies_id`),
57 KEY `fk_comments_accounts1_idx` (`accounts_id`),
58 CONSTRAINT `fk_comments_accounts1` FOREIGN KEY (`accounts_id`) REFERENCES `accounts` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
59 CONSTRAINT `fk_comments_noticies1` FOREIGN KEY (`noticies_id`) REFERENCES `notices` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
60) ENGINE=InnoDB DEFAULT CHARSET=utf8;
61
62-- Copiando dados para a tabela l2kael.comments: ~0 rows (aproximadamente)
63/*!40000 ALTER TABLE `comments` DISABLE KEYS */;
64/*!40000 ALTER TABLE `comments` ENABLE KEYS */;
65
66-- Copiando estrutura para tabela l2kael.like_ips
67DROP TABLE IF EXISTS `like_ips`;
68CREATE TABLE IF NOT EXISTS `like_ips` (
69 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
70 `ip` varchar(15) NOT NULL,
71 `noticies_id` int(10) unsigned NOT NULL,
72 PRIMARY KEY (`id`),
73 KEY `fk_like_noticies1_idx` (`noticies_id`),
74 CONSTRAINT `fk_like_noticies1` FOREIGN KEY (`noticies_id`) REFERENCES `notices` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
75) ENGINE=InnoDB DEFAULT CHARSET=utf8;
76
77-- Copiando dados para a tabela l2kael.like_ips: ~0 rows (aproximadamente)
78/*!40000 ALTER TABLE `like_ips` DISABLE KEYS */;
79/*!40000 ALTER TABLE `like_ips` ENABLE KEYS */;
80
81-- Copiando estrutura para tabela l2kael.notices
82DROP TABLE IF EXISTS `notices`;
83CREATE TABLE IF NOT EXISTS `notices` (
84 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
85 `title_en` varchar(50) NOT NULL,
86 `title_ptbr` varchar(50) NOT NULL,
87 `title_es` varchar(50) NOT NULL,
88 `text_en` text NOT NULL,
89 `text_ptbr` text NOT NULL,
90 `text_es` text NOT NULL,
91 `time` datetime NOT NULL,
92 `image` varchar(50) NOT NULL,
93 `active` tinyint(1) NOT NULL,
94 `view` int(11) DEFAULT '0',
95 `like` int(11) DEFAULT '0',
96 `categories_id` int(10) unsigned NOT NULL,
97 `accounts_id` int(10) unsigned NOT NULL,
98 PRIMARY KEY (`id`),
99 UNIQUE KEY `image_UNIQUE` (`image`),
100 KEY `fk_noticies_categories1_idx` (`categories_id`),
101 KEY `fk_noticies_accounts1_idx` (`accounts_id`),
102 CONSTRAINT `fk_noticies_accounts1` FOREIGN KEY (`accounts_id`) REFERENCES `accounts` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
103 CONSTRAINT `fk_noticies_categories1` FOREIGN KEY (`categories_id`) REFERENCES `categories` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
104) ENGINE=InnoDB DEFAULT CHARSET=utf8;
105
106-- Copiando dados para a tabela l2kael.notices: ~0 rows (aproximadamente)
107/*!40000 ALTER TABLE `notices` DISABLE KEYS */;
108/*!40000 ALTER TABLE `notices` ENABLE KEYS */;
109
110-- Copiando estrutura para tabela l2kael.view_ips
111DROP TABLE IF EXISTS `view_ips`;
112CREATE TABLE IF NOT EXISTS `view_ips` (
113 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
114 `ip` varchar(15) NOT NULL,
115 `noticies_id` int(10) unsigned NOT NULL,
116 PRIMARY KEY (`id`),
117 KEY `fk_view_ips_noticies1_idx` (`noticies_id`),
118 CONSTRAINT `fk_view_ips_noticies1` FOREIGN KEY (`noticies_id`) REFERENCES `notices` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
119) ENGINE=InnoDB DEFAULT CHARSET=utf8;
120
121-- Copiando dados para a tabela l2kael.view_ips: ~0 rows (aproximadamente)
122/*!40000 ALTER TABLE `view_ips` DISABLE KEYS */;
123/*!40000 ALTER TABLE `view_ips` ENABLE KEYS */;
124
125/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
126/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
127/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;