forked from freem/OpenSMO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init_db.sql
130 lines (113 loc) · 4.63 KB
/
init_db.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
DROP TABLE IF EXISTS `bans`;
CREATE TABLE `bans` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`IP` text COLLATE utf8_unicode_ci NOT NULL,
`From` int(11) NOT NULL,
`Date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `connectionlog`;
CREATE TABLE `connectionlog` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userid` int(11) NOT NULL,
`username` text COLLATE utf8_unicode_ci NOT NULL,
`password` text COLLATE utf8_unicode_ci NOT NULL,
`ip` text COLLATE utf8_unicode_ci NOT NULL,
`result` enum('suceeded','failed') COLLATE utf8_unicode_ci NOT NULL,
`clientversion` text COLLATE utf8_unicode_ci NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `fixedrooms`;
CREATE TABLE `fixedrooms` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`Description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`Password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`Free` int(11) NOT NULL,
`MOTD` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`Operators` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `news`;
CREATE TABLE `news` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Author` int(11) NOT NULL,
`Title` text COLLATE utf8_unicode_ci NOT NULL,
`Content` text COLLATE utf8_unicode_ci NOT NULL,
`TimeStamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `rooms`;
CREATE TABLE `rooms` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`Description` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`Owner` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
`Created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `settings`;
CREATE TABLE `settings` (
`Key` text COLLATE utf8_unicode_ci NOT NULL,
`Value` text COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `songs`;
CREATE TABLE `songs` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Name` text COLLATE utf8_unicode_ci NOT NULL,
`Artist` text COLLATE utf8_unicode_ci NOT NULL,
`SubTitle` text COLLATE utf8_unicode_ci NOT NULL,
`Played` int(11) NOT NULL,
`Time` int(11) NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `stats`;
CREATE TABLE `stats` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`User` int(11) NOT NULL,
`PlayerSettings` text COLLATE utf8_unicode_ci NOT NULL,
`Song` int(11) NOT NULL,
`Room` int(11) NOT NULL,
`Feet` int(11) NOT NULL,
`Difficulty` int(11) NOT NULL,
`Grade` int(11) NOT NULL,
`Score` int(11) NOT NULL,
`MaxCombo` int(11) NOT NULL,
`Note_0` int(11) NOT NULL,
`Note_1` int(11) NOT NULL,
`Note_Mine` int(11) NOT NULL,
`Note_Miss` int(11) NOT NULL,
`Note_Barely` int(11) NOT NULL,
`Note_Good` int(11) NOT NULL,
`Note_Great` int(11) NOT NULL,
`Note_Perfect` int(11) NOT NULL,
`Note_Flawless` int(11) NOT NULL,
`Note_NG` int(11) NOT NULL,
`Note_Held` int(11) NOT NULL,
`rate` int(11) NOT NULL,
`Toasty` int(6) NOT NULL,
`timing` int(8) NOT NULL,
`TimeStamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Username` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`Password` text COLLATE utf8_unicode_ci NOT NULL,
`Email` text COLLATE utf8_unicode_ci NOT NULL,
`Rank` int(11) NOT NULL,
`XP` int(11) NOT NULL,
`Joined` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`ID`),
KEY `Username` (`Username`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `friends`;
CREATE TABLE `friends` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`user` int(11) NOT NULL,
`friend` int(11) NOT NULL,
`Created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;