-
Notifications
You must be signed in to change notification settings - Fork 0
/
initdb.sql
54 lines (50 loc) · 2.32 KB
/
initdb.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
CREATE TABLE `season_statistic` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`seasonId` int(11) NOT NULL DEFAULT '0',
`tag` varchar(64) NOT NULL DEFAULT '',
`name` varchar(64) NOT NULL DEFAULT '',
`role` varchar(16) NOT NULL DEFAULT '',
`expLevel` int(10) unsigned NOT NULL DEFAULT '0',
`league` varchar(4048) NOT NULL DEFAULT '{}',
`trophies` int(10) unsigned NOT NULL DEFAULT '0',
`versusTrophies` int(10) unsigned NOT NULL DEFAULT '0',
`clanRank` int(10) unsigned NOT NULL DEFAULT '0',
`previousClanRank` int(10) unsigned NOT NULL DEFAULT '0',
`attackWins` int(10) NOT NULL DEFAULT '0',
`donations` int(10) unsigned NOT NULL DEFAULT '0',
`donationsReceived` int(10) unsigned NOT NULL DEFAULT '0',
`createAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `idx_seasonId` (`seasonId`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
CREATE TABLE `season` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`status` int(11) NOT NULL DEFAULT '0',
`createAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
UNIQUE KEY `unq_name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
CREATE TABLE `daily_statistic` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`tag` varchar(15) NOT NULL DEFAULT '',
`name` varchar(64) NOT NULL DEFAULT '',
`expLevel` int(10) unsigned NOT NULL DEFAULT '0',
`trophies` int(10) unsigned NOT NULL DEFAULT '0',
`versusTrophies` int(10) unsigned NOT NULL DEFAULT '0',
`attackWins` int(10) unsigned NOT NULL DEFAULT '0',
`donations` int(10) unsigned NOT NULL DEFAULT '0',
`donationsReceived` int(10) unsigned NOT NULL DEFAULT '0',
`gold` int(10) unsigned NOT NULL DEFAULT '0',
`elixir` int(10) unsigned NOT NULL DEFAULT '0',
`darkElixir` int(10) unsigned NOT NULL DEFAULT '0',
`dateTimeTag` datetime NOT NULL,
`createAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `idx_dateTimeTag` (`dateTimeTag`),
KEY `idx_tag` (`tag`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;