-
Notifications
You must be signed in to change notification settings - Fork 9
/
create_database.sql
88 lines (76 loc) · 3.8 KB
/
create_database.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
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 */;
CREATE TABLE IF NOT EXISTS `activity` (
`activity_id` int(11) NOT NULL AUTO_INCREMENT,
`event` int(11) NOT NULL,
`activity_time` int(11) NOT NULL,
`username` varchar(255) NOT NULL,
PRIMARY KEY (`activity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `colours` (
`colour_id` int(11) NOT NULL AUTO_INCREMENT,
`colour_name` varchar(50) NOT NULL,
`hexcode` varchar(7) NOT NULL,
`precedence` int(11) NOT NULL,
`updated` int(11) NOT NULL,
`updated_by` int(11) NOT NULL,
`created` int(11) NOT NULL,
`created_by` int(11) NOT NULL,
PRIMARY KEY (`colour_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;
INSERT INTO `colours` (`colour_id`, `colour_name`, `hexcode`, `precedence`, `updated`, `updated_by`, `created`, `created_by`) VALUES
(1, 'Charcoal', '#333333', 1, 1376908004, 1, 1376908004, 1),
(2, 'Red', '#c12c0f', 2, 1376908004, 1, 1376908004, 1),
(3, 'Blue', '#4b8cdc', 3, 1376908004, 1, 1376908004, 1),
(4, 'Green', '#42bc21', 4, 1376908004, 1, 1376908004, 1),
(5, 'Purple', '#bc2179', 5, 1376908004, 1, 1376908004, 1),
(6, 'Burnt Orange', '#bc6321', 6, 1376908004, 1, 1376908004, 1),
(7, 'Light Green', '#92bc21', 7, 1376908004, 1, 1376908004, 1),
(8, 'Aqua', '#21bc5b', 8, 1376908004, 1, 1376908004, 1),
(9, 'Grey', '#7c7c7c', 9, 1376908004, 1, 1376908004, 1);
CREATE TABLE IF NOT EXISTS `events` (
`event_id` int(11) NOT NULL AUTO_INCREMENT,
`event_name` varchar(100) DEFAULT NULL,
`event_description` text NOT NULL,
`updated` int(11) NOT NULL,
`updated_by` int(11) NOT NULL,
`created` int(11) NOT NULL,
`created_by` int(11) NOT NULL,
PRIMARY KEY (`event_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
INSERT INTO `events` (`event_id`, `event_name`, `event_description`, `updated`, `updated_by`, `created`, `created_by`) VALUES
(1, 'User connected', 'A new user has connected', 1376579841, 1, 1376579841, 1),
(2, 'User disconnect', 'A user has disconnected and left the chat', 1376579841, 1, 1376579841, 1),
(3, 'Invite sent', 'A user user has sent an invite to their room', 1376579841, 1, 1376579841, 1),
(4, 'Invite accepted', 'A user user has accepted an invite', 1376579841, 1, 1376579841, 1),
(5, 'Invite rejected', 'A user user has rejected an invite', 1376579841, 1, 1376579841, 1),
(6, 'Left room', 'A user has left a room', 1376579841, 1, 1376579841, 1),
(7, 'Joined room', 'A user has joined a room', 1376579841, 1, 1376579841, 1);
CREATE TABLE IF NOT EXISTS `messages` (
`message_id` int(11) NOT NULL AUTO_INCREMENT,
`message_text` text NOT NULL,
`message_sent` varchar(100) NOT NULL,
`message_from` varchar(255) NOT NULL,
`room` varchar(255) NOT NULL,
`message_type_id` int(11) NOT NULL,
PRIMARY KEY (`message_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `message_types` (
`message_type_id` int(11) NOT NULL AUTO_INCREMENT,
`message_type_name` varchar(100) NOT NULL,
`updated` int(11) NOT NULL,
`updated_by` int(11) NOT NULL,
`created` int(11) NOT NULL,
`created_by` int(11) NOT NULL,
PRIMARY KEY (`message_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
INSERT INTO `message_types` (`message_type_id`, `message_type_name`, `updated`, `updated_by`, `created`, `created_by`) VALUES
(1, 'normal', 1376643981, 1, 1376643981, 1),
(2, 'code', 1376643981, 1, 1376643981, 1);
/*!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 */;