-
Notifications
You must be signed in to change notification settings - Fork 14
/
brtalk-1_1_0.sql
109 lines (91 loc) · 3.38 KB
/
brtalk-1_1_0.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!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 */;
--
-- Estrutura da tabela `client`
--
CREATE TABLE IF NOT EXISTS `client` (
`client_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL DEFAULT '0',
`status` tinyint(3) unsigned NOT NULL DEFAULT '1',
`typing` tinyint(3) unsigned NOT NULL DEFAULT '0',
`name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`ip_address` char(12) NOT NULL,
`call_date` datetime NOT NULL,
`start_call_date` datetime DEFAULT NULL,
`time` varchar(20) NOT NULL,
PRIMARY KEY (`client_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
--
-- Estrutura da tabela `client_history`
--
CREATE TABLE IF NOT EXISTS `client_history` (
`client_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL DEFAULT '0',
`status` tinyint(3) unsigned NOT NULL DEFAULT '1',
`typing` tinyint(3) unsigned NOT NULL DEFAULT '0',
`name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`ip_address` char(12) NOT NULL,
`call_date` datetime NOT NULL,
`start_call_date` datetime DEFAULT NULL,
`time` varchar(20) NOT NULL,
PRIMARY KEY (`client_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Estrutura da tabela `message`
--
CREATE TABLE IF NOT EXISTS `message` (
`message_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`client_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`type` tinyint(1) unsigned NOT NULL DEFAULT '0',
`status` tinyint(1) unsigned NOT NULL DEFAULT '1',
`message` text NOT NULL,
`post_date` datetime NOT NULL,
PRIMARY KEY (`message_id`),
KEY `client_id` (`client_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
--
-- Estrutura da tabela `message_history`
--
CREATE TABLE IF NOT EXISTS `message_history` (
`message_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`client_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`type` tinyint(1) unsigned NOT NULL DEFAULT '0',
`status` tinyint(1) unsigned NOT NULL DEFAULT '1',
`message` text NOT NULL,
`post_date` datetime NOT NULL,
PRIMARY KEY (`message_id`),
KEY `client_id` (`client_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
--
-- Estrutura da tabela `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`user_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`status` tinyint(1) unsigned NOT NULL DEFAULT '1',
`typing` tinyint(1) unsigned NOT NULL DEFAULT '0',
`level` tinyint(1) unsigned NOT NULL DEFAULT '1',
`name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`photo` varchar(32) DEFAULT NULL,
`user` varchar(32) NOT NULL,
`password` char(40) NOT NULL,
`register_date` datetime NOT NULL,
`time` varchar(20) NOT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
--
-- Extraindo dados da tabela `user`
--
INSERT INTO `user` (`user_id`, `status`, `typing`, `level`, `name`, `email`, `photo`, `user`, `password`, `register_date`, `time`) VALUES
(1, 1, 0, 1, 'Administrador', '[email protected]', NULL, 'administrador', '4730afa938571a7268c65e8bd9c59ad7ca47a8d6', NOW(), '0');