-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_migration.sql
57 lines (48 loc) · 2.14 KB
/
setup_migration.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
-- ------------------------------------------------------------------------------------------------
-- This example script sets up all database tables needed for the chat system itself,
-- but without tables for game world environment.
-- If you change table names, you have to modify the config (See SQL_TABLES).
-- If you change table structure, you have to modify the related queries of the datasource class.
-- ------------------------------------------------------------------------------------------------
-- MySQL server version: 5.6.12
-- ------------------------------------------------------------------------------------------------
--
-- Scheme for table of channel list
--
CREATE TABLE IF NOT EXISTS `chat - channels` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`GameID` tinyint(5) unsigned NOT NULL,
`CreatorUserID` int(10) unsigned NOT NULL,
`Title` tinytext NOT NULL,
`Password` tinytext NOT NULL,
`IrcChannel` tinytext,
`IsPublic` tinyint(1) unsigned NOT NULL,
PRIMARY KEY (`ID`),
KEY `GameID` (`GameID`),
KEY `CreatorUserID` (`CreatorUserID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored custom/non-default channels';
-- --------------------------------------------------------
--
-- Scheme for table of channel joinings
--
CREATE TABLE IF NOT EXISTS `chat - channeljoins` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`UserID` int(10) unsigned NOT NULL,
`ChannelID` int(10) unsigned NOT NULL,
PRIMARY KEY (`UserID`,`ChannelID`),
UNIQUE KEY `ID` (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Current channel joins of clients/players';
-- --------------------------------------------------------
--
-- Scheme for table of channel logs
--
CREATE TABLE IF NOT EXISTS `chat - channellogs` (
`ChannelLogID` bigint(10) unsigned NOT NULL,
`ChannelBufferID` smallint(5) unsigned NOT NULL,
`ChannelTextID` varchar(50) NOT NULL,
`ChannelID` int(10) unsigned NOT NULL,
`EventTextID` varchar(25) NOT NULL,
`EventData` text NOT NULL,
`Timestamp` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`ChannelBufferID`,`ChannelTextID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='Current chat history of all channels';