-
Notifications
You must be signed in to change notification settings - Fork 129
/
sql_updates.txt
165 lines (137 loc) · 7.62 KB
/
sql_updates.txt
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
-- 21.06.2018 -> added one column and one index
ALTER TABLE `s1_artefacts` ADD `del` TINYINT(1) NULL DEFAULT '0' AFTER `lastupdate`;
ALTER TABLE `testtravian`.`s1_artefacts` ADD INDEX `active-owner-conquered-del` (`active`, `owner`, `conquered`, `del`);
-- 21.05.2018 -> added three indexes
ALTER TABLE `s1_forum_cat` ADD INDEX `display_to_alliances` (`display_to_alliances`(11));
ALTER TABLE `s1_forum_cat` ADD INDEX `display_to_users` (`display_to_users`(11));
ALTER TABLE `s1_forum_cat` ADD INDEX `sorting` (`sorting`);
-- 20.05.2018 -> dropped eight columns
ALTER TABLE `s1_forum_topic`
DROP `alliance0`,
DROP `player0`,
DROP `coor0`,
DROP `report0`;
ALTER TABLE `s1_forum_post`
DROP `alliance0`,
DROP `player0`,
DROP `coor0`,
DROP `report0`;
-- 19.05.2018 -> added two new columns
ALTER TABLE s1_forum_cat ADD (`display_to_alliances` text, `display_to_users` text)
-- 18.05.2018 -> added a new column
ALTER TABLE s1_forum_cat ADD `sorting` int(11) NOT NULL AFTER `id`
-- 16.05.2018 -> dropped four columns
ALTER TABLE `s1_raidlist` DROP `t7`, DROP `t8`, DROP `t9`, DROP `t10`;
-- 23.04.2018 -> new table
CREATE TABLE IF NOT EXISTS `s1_artefacts_chrono` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`artefactid` int(11) NULL,
`uid` int(11) NULL,
`vref` int(11) NULL,
`conqueredtime` int(11) NULL,
PRIMARY KEY (`id`),
KEY `artefactid-conqueredtime` (`artefactid`,`conqueredtime`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
-- 7.01.2018 -> new column
ALTER TABLE s1_fdata ADD `ww_lastupdate` int(11) NULL DEFAULT NULL AFTER `wwname`;
-- 2.12.2017 -> new indexes
ALTER TABLE `s1_vdata` ADD INDEX(`exp1`);
ALTER TABLE `s1_vdata` ADD INDEX(`exp2`);
ALTER TABLE `s1_vdata` ADD INDEX(`exp3`);
-- 17.11.2017 -> query optimizations
ALTER TABLE `s1_prisoners` DROP INDEX `from`, ADD INDEX `from-t11` (`from`, `t11`);
ALTER TABLE `s1_enforcement` DROP INDEX `from`, ADD INDEX `from` (`from`, `hero`) USING BTREE;
ALTER TABLE `s1_forum_post` CHANGE `date` `date` INT NULL DEFAULT NULL;
ALTER TABLE `s1_market` DROP INDEX `vref-accept`, ADD INDEX `vref-accept-merchant` (`vref`, `accept`, `merchant`) USING BTREE;
ALTER TABLE `s1_mdata` ADD INDEX `target-viewed` (`target`, `viewed`);
ALTER TABLE `s1_ndata` ADD INDEX `uid-viewed` (`uid`, `viewed`);
-- 8.11.2017 -> query optimizations and cleanups
ALTER TABLE `s1_ww_attacks` ADD INDEX(`vid`);
-- 2.11.2017 -> Hero fixes
ALTER TABLE `s1_hero` ADD INDEX(`lastupdate`);
ALTER TABLE `s1_hero` DROP INDEX `uid`, ADD INDEX `uid` (`uid`, `dead`) USING BTREE;
ALTER TABLE `s1_hero` ADD INDEX(`inrevive`);
ALTER TABLE `s1_hero` ADD INDEX(`intraining`);
-- 31.10.2017 -> Embassy and alliance updates
ALTER TABLE `s1_ali_permission` ADD INDEX(`alliance`);
ALTER TABLE `s1_allimedal` ADD INDEX(`allyid`);
ALTER TABLE `s1_ali_permission` DROP INDEX `uid-alliance`, ADD UNIQUE `uid-alliance` (`uid`, `alliance`) USING BTREE;
-- 27.10.2017 -> SQL optimizations
ALTER TABLE `s1_route` ADD INDEX `uid-timestamp` (`uid`, `timestamp`);
-- 24.10.2017 -> SQL optimizations
ALTER TABLE `s1_users` ADD INDEX(`sit1`);
ALTER TABLE `s1_users` ADD INDEX(`sit2`);
ALTER TABLE `s1_ndata` ADD INDEX(`toWref`);
ALTER TABLE `s1_wdata` ADD INDEX `x-y` (`x`, `y`);
ALTER TABLE `s1_a2b` ADD INDEX `ckey` (`ckey`(25));
ALTER TABLE `s1_ali_permission` ADD INDEX `uid-alliance` (`uid`, `alliance`);
ALTER TABLE `s1_forum_cat` CHANGE `alliance` `alliance` INT NOT NULL;
ALTER TABLE `s1_forum_cat` ADD INDEX `alliance-forum_area` (`alliance`, `forum_area`);
ALTER TABLE `s1_forum_topic` CHANGE `cat` `cat` INT NOT NULL;
ALTER TABLE `s1_forum_topic` ADD INDEX `cat-stick` (`cat`, `stick`);
ALTER TABLE `s1_forum_edit` CHANGE `alliance` `alliance` INT NOT NULL;
ALTER TABLE `s1_forum_edit` ADD INDEX(`alliance`);
ALTER TABLE `s1_forum_post` CHANGE `topic` `topic` INT NOT NULL, CHANGE `owner` `owner` INT NOT NULL;
ALTER TABLE `s1_forum_topic` CHANGE `post_date` `post_date` INT NOT NULL;
ALTER TABLE `s1_forum_topic` CHANGE `owner` `owner` INT NOT NULL, CHANGE `alliance` `alliance` INT NOT NULL, CHANGE `ends` `ends` INT NOT NULL, CHANGE `close` `close` TINYINT NOT NULL, CHANGE `stick` `stick` TINYINT NOT NULL;
ALTER TABLE `s1_forum_topic` CHANGE `date` `date` INT NOT NULL;
ALTER TABLE `s1_ali_log` ADD INDEX(`aid`);
ALTER TABLE `s1_alidata` ADD INDEX(`tag`);
ALTER TABLE `s1_alidata` ADD INDEX(`name`);
ALTER TABLE `s1_alidata` ADD INDEX(`leader`);
ALTER TABLE `s1_ali_invite` ADD INDEX `alliance-accept` (`alliance`, `accept`);
ALTER TABLE `s1_ali_invite` ADD INDEX(`uid`);
ALTER TABLE `s1_users` ADD INDEX(`gold`);
ALTER TABLE `s1_farmlist` ADD INDEX(`owner`);
ALTER TABLE `s1_raidlist` CHANGE `distance` `distance` FLOAT NULL DEFAULT '0';
ALTER TABLE `s1_raidlist` ADD INDEX `lid-distance` (`lid`, `distance`);
ALTER TABLE `s1_artefacts` ADD INDEX `size-type` (`size`, `type`);
ALTER TABLE `s1_odata` ADD INDEX(`maxstore`);
ALTER TABLE `s1_odata` ADD INDEX(`maxcrop`);
-- 23.10.2017 -> SQL optimizations
ALTER TABLE `s1_medal` ADD INDEX(`week`);
ALTER TABLE `s1_market` ADD INDEX `vref-accept` (`vref`, `accept`);
ALTER TABLE `s1_fdata` ADD INDEX(`f99`);
ALTER TABLE `s1_fdata` ADD INDEX(`f99t`);
ALTER TABLE `s1_diplomacy` ADD INDEX(`alli1`);
ALTER TABLE `s1_diplomacy` ADD INDEX(`alli2`);
ALTER TABLE `s1_diplomacy` ADD INDEX `type-accepted` (`type`, `accepted`);
ALTER TABLE `s1_wdata` ADD INDEX(`fieldtype`);
-- 22.10.2017 -> SQL optimizations
ALTER TABLE `s1_users` ADD INDEX(`tribe`);
ALTER TABLE `s1_users` ADD INDEX `timestamp-tribe` (`timestamp`, `tribe`);
ALTER TABLE `s1_users` DROP INDEX `username`;
ALTER TABLE `s1_users` ADD UNIQUE `username` (`username`);
ALTER TABLE `s1_activate` CHANGE `username` `username` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE `s1_activate` ADD UNIQUE `username` (`username`);
ALTER TABLE `s1_activate` CHANGE `email` `email` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE `s1_activate` ADD UNIQUE(`email`);
ALTER TABLE `s1_users` CHANGE `email` `email` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
-- YOU MAY NOT NEED THESE IF YOUR EMAILS FOR THESE 3 ACCOUNTS ARE ALREADY DIFFERENT FROM ONE ANOTHER
UPDATE `s1_users` SET `email` = '[email protected]' WHERE `s1_users`.`id` = 1;
UPDATE `s1_users` SET `email` = '[email protected]' WHERE `s1_users`.`id` = 2;
UPDATE `s1_users` SET `email` = '[email protected]' WHERE `s1_users`.`id` = 4;
-- END OF "YOU MAY NOT NEED THESE"
ALTER TABLE `s1_users` ADD UNIQUE `email` (`email`);
ALTER TABLE `s1_users` ADD INDEX(`access`);
ALTER TABLE `s1_active` ADD INDEX(`timestamp`);
ALTER TABLE `s1_odata` ADD INDEX(`clay`);
ALTER TABLE `s1_odata` ADD INDEX(`crop`);
ALTER TABLE `s1_odata` ADD INDEX(`iron`);
ALTER TABLE `s1_odata` ADD INDEX(`wood`);
ALTER TABLE `s1_vdata` ADD INDEX(`crop`);
ALTER TABLE `s1_vdata` ADD INDEX(`iron`);
ALTER TABLE `s1_vdata` ADD INDEX(`clay`);
ALTER TABLE `s1_vdata` ADD INDEX(`wood`);
ALTER TABLE `s1_deleting` ADD INDEX(`timestamp`);
ALTER TABLE `s1_movement` ADD INDEX `proc-sort_type-endtime` (`proc`, `sort_type`, `endtime`);
ALTER TABLE `s1_vdata` ADD INDEX(`starv`);
ALTER TABLE `s1_vdata` ADD INDEX(`loyalty`);
ALTER TABLE `s1_odata` ADD INDEX(`loyalty`);
ALTER TABLE `s1_artefacts` ADD INDEX `active-type-lastupdate` (`active`, `type`, `lastupdate`);
-- 22.10.2017 -> forum topics table and indexe changes
ALTER TABLE `s1_forum_post` CHANGE `topic` `topic` INT NULL DEFAULT NULL;
ALTER TABLE `s1_forum_post` CHANGE `owner` `owner` INT NULL DEFAULT NULL;
ALTER TABLE `s1_forum_post` ADD INDEX `topic-owner` (`topic`, `owner`);
-- 20.10.2017 -> changing MD5 for bcrypt password hashing algo
ALTER TABLE `s1_users` ADD `is_bcrypt` TINYINT(1) NOT NULL DEFAULT '0' AFTER `vactwoweeks`;