This repository has been archived by the owner on Jun 24, 2020. It is now read-only.
forked from TheNAF/naflm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
280 lines (222 loc) · 15.6 KB
/
INSTALL
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
-------
INSTALL
-------
See http://www.nicholasmr.dk/obblmwiki/index.php?title=Installation
---------
UPGRADING
---------
NOTE: When upgrading please save your old settings file(s) as a reference for when filling out the new settings file(s).
0.75 -> Any larger version
Replace all OBBLM files.
Run the upgrade.php file from a web-browser.
0.7 -> 0.75
Replace all OBBLM files.
Execute the following MySQL queries:
ALTER TABLE players ADD COLUMN extra_val MEDIUMINT SIGNED NOT NULL DEFAULT 0 AFTER extra_spp;
ALTER TABLE matches ADD COLUMN fame1 TINYINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE matches ADD COLUMN fame2 TINYINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE matches ADD COLUMN tv1 MEDIUMINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE matches ADD COLUMN tv2 MEDIUMINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE matches ADD COLUMN hash_botocs VARCHAR(32);
ALTER TABLE teams ADD COLUMN f_race_id TINYINT UNSIGNED NOT NULL DEFAULT 0 AFTER race;
UPDATE teams SET f_race_id = 0 WHERE race = 'Amazon';
UPDATE teams SET f_race_id = 1 WHERE race = 'Chaos';
UPDATE teams SET f_race_id = 2 WHERE race = 'Chaos Dwarf';
UPDATE teams SET f_race_id = 3 WHERE race = 'Dark Elf';
UPDATE teams SET f_race_id = 4 WHERE race = 'Dwarf';
UPDATE teams SET f_race_id = 5 WHERE race = 'Elf';
UPDATE teams SET f_race_id = 6 WHERE race = 'Goblin';
UPDATE teams SET f_race_id = 7 WHERE race = 'Halfling';
UPDATE teams SET f_race_id = 8 WHERE race = 'High Elf';
UPDATE teams SET f_race_id = 9 WHERE race = 'Human';
UPDATE teams SET f_race_id = 10 WHERE race = 'Khemri';
UPDATE teams SET f_race_id = 11 WHERE race = 'Lizardman';
UPDATE teams SET f_race_id = 12 WHERE race = 'Orc';
UPDATE teams SET f_race_id = 13 WHERE race = 'Necromantic';
UPDATE teams SET f_race_id = 14 WHERE race = 'Norse';
UPDATE teams SET f_race_id = 15 WHERE race = 'Nurgle';
UPDATE teams SET f_race_id = 16 WHERE race = 'Ogre';
UPDATE teams SET f_race_id = 17 WHERE race = 'Undead';
UPDATE teams SET f_race_id = 18 WHERE race = 'Vampire';
UPDATE teams SET f_race_id = 19 WHERE race = 'Skaven';
UPDATE teams SET f_race_id = 20 WHERE race = 'Wood Elf';
UPDATE teams SET f_race_id = 21 WHERE race = 'Chaos Pact';
UPDATE teams SET f_race_id = 22 WHERE race = 'Slann';
UPDATE teams SET f_race_id = 23 WHERE race = 'Underworld';
ALTER TABLE match_data ADD COLUMN f_race_id TINYINT UNSIGNED AFTER f_player_id;
UPDATE match_data, teams SET match_data.f_race_id = teams.f_race_id WHERE match_data.f_team_id = teams.team_id;
ALTER TABLE teams DROP race;
UPDATE tours SET type = IF(type = 1, 2, 1);
UPDATE match_data, tours, divisions SET
match_data.f_race_id = NULL,
match_data.f_did = tours.f_did,
match_data.f_lid = divisions.f_lid
WHERE
match_data.f_tour_id = tours.tour_id AND
tours.f_did = divisions.did AND
f_player_id < 0;
ALTER TABLE tours ADD COLUMN locked BOOLEAN;
ALTER TABLE match_data ADD INDEX idx_r_tr (f_race_id, f_tour_id);
ALTER TABLE match_data ADD INDEX idx_r_m (f_race_id, f_match_id);
UPDATE players, teams SET position = 'Lineman' WHERE owned_by_team_id = team_id AND f_race_id = 19 AND position = 'Linerat';
UPDATE players, teams SET position = 'Mummy' WHERE owned_by_team_id = team_id AND f_race_id = 17 AND position = 'Mummie';
UPDATE players, teams SET position = 'Mummy' WHERE owned_by_team_id = team_id AND f_race_id = 10 AND position = 'Mummie';
0.37 -> 0.7
Replace all OBBLM files.
Execute the following MySQL queries:
ALTER TABLE matches ADD COLUMN smp1 TINYINT SIGNED NOT NULL DEFAULT 0;
ALTER TABLE matches ADD COLUMN smp2 TINYINT SIGNED NOT NULL DEFAULT 0;
ALTER TABLE matches ADD COLUMN tcas1 TINYINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE matches ADD COLUMN tcas2 TINYINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE matches ADD COLUMN fans MEDIUMINT UNSIGNED NOT NULL DEFAULT 0 AFTER gate;
ALTER TABLE teams ADD COLUMN imported BOOLEAN NOT NULL DEFAULT 0;
ALTER TABLE teams ADD COLUMN won_0 SMALLINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE teams ADD COLUMN lost_0 SMALLINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE teams ADD COLUMN draw_0 SMALLINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE teams ADD COLUMN sw_0 SMALLINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE teams ADD COLUMN sl_0 SMALLINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE teams ADD COLUMN sd_0 SMALLINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE teams ADD COLUMN wt_0 SMALLINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE teams ADD COLUMN gf_0 SMALLINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE teams ADD COLUMN ga_0 SMALLINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE teams ADD COLUMN elo_0 SMALLINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE teams ADD COLUMN tcas_0 SMALLINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE coaches ADD COLUMN ring TINYINT UNSIGNED NOT NULL DEFAULT 0;
UPDATE coaches SET ring = 2 WHERE admin = 0 OR admin IS NULL;
ALTER TABLE coaches DROP admin;
ALTER TABLE coaches ADD COLUMN settings VARCHAR(320) NOT NULL;
ALTER TABLE coaches ADD COLUMN retired BOOLEAN NOT NULL DEFAULT 0;
ALTER TABLE teams ADD COLUMN retired BOOLEAN NOT NULL DEFAULT 0 AFTER imported;
CREATE TABLE IF NOT EXISTS prizes
(
prize_id MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
team_id MEDIUMINT UNSIGNED NOT NULL DEFAULT 0,
tour_id MEDIUMINT UNSIGNED NOT NULL DEFAULT 0,
type TINYINT UNSIGNED NOT NULL DEFAULT 0,
date DATETIME,
title VARCHAR(100),
txt TEXT
);
ALTER TABLE coaches ADD COLUMN phone VARCHAR(25) NOT NULL AFTER mail;
ALTER TABLE coaches ADD COLUMN realname VARCHAR(50) NOT NULL AFTER name;
ALTER TABLE teams ADD COLUMN rdy BOOLEAN NOT NULL DEFAULT 1 AFTER cheerleaders;
ALTER TABLE teams MODIFY elo_0 FLOAT SIGNED NOT NULL DEFAULT 0;
CREATE TABLE IF NOT EXISTS leagues
(
lid MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(50),
location VARCHAR(50),
date DATETIME
);
CREATE TABLE IF NOT EXISTS divisions
(
did MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
f_lid MEDIUMINT UNSIGNED,
name VARCHAR(50)
);
ALTER TABLE tours ADD COLUMN f_did MEDIUMINT UNSIGNED AFTER tour_id;
ALTER TABLE match_data ADD COLUMN f_did MEDIUMINT UNSIGNED AFTER f_tour_id;
ALTER TABLE match_data ADD COLUMN f_lid MEDIUMINT UNSIGNED AFTER f_did;
-- ---------------------------------------------------------
-- NOTICE !!! The below code SHOULD NOT be executed twice!!!
-- ---------------------------------------------------------
INSERT INTO leagues (name, location, date) VALUES ('My league', 'My location', NOW());
INSERT INTO divisions (name, f_lid) VALUES ('My division', 1);
UPDATE tours SET f_did = 1;
UPDATE match_data SET f_did = 1, f_lid = 1;
-- ---------------------------------------------------------
-- END OF NOTICE.
-- ---------------------------------------------------------
0.36 -> 0.37
Replace all OBBLM files.
Execute the following (Yes, there are many this time!) MySQL queries:
ALTER TABLE match_data MODIFY f_player_id MEDIUMINT SIGNED;
INSERT INTO texts (type, f_id, txt) SELECT 7, match_id, comment FROM matches ORDER BY match_id ASC;
ALTER TABLE matches DROP comment;
UPDATE players SET `ach_nor_skills` = REPLACE(`ach_nor_skills`, "Dumb-Off", "Dump-Off") WHERE `ach_nor_skills` LIKE "%Dumb-Off%";
UPDATE players SET `ach_dob_skills` = REPLACE(`ach_dob_skills`, "Dumb-Off", "Dump-Off") WHERE `ach_dob_skills` LIKE "%Dumb-Off%";
UPDATE players SET `extra_skills` = REPLACE(`extra_skills`, "Dumb-Off", "Dump-Off") WHERE `extra_skills` LIKE "%Dumb-Off%";
ALTER TABLE match_data ADD COLUMN f_tour_id MEDIUMINT UNSIGNED AFTER f_match_id;
UPDATE match_data, matches SET match_data.f_tour_id = matches.f_tour_id WHERE match_data.f_match_id = matches.match_id;
UPDATE match_data, teams SET f_coach_id = owned_by_coach_id WHERE f_team_id = team_id;
ALTER TABLE match_data MODIFY f_match_id MEDIUMINT SIGNED;
ALTER TABLE matches MODIFY match_id MEDIUMINT SIGNED NOT NULL AUTO_INCREMENT;
UPDATE match_data, matches SET f_match_id = -1 WHERE f_match_id = match_id AND team1_id = 0 AND team2_id = 0 AND round = 0 AND matches.f_tour_id = 0;
UPDATE matches SET match_id = -1 WHERE team1_id = 0 AND team2_id = 0 AND round = 0 AND matches.f_tour_id = 0;
UPDATE teams SET `race` = REPLACE(`race`, "Amazons", "Amazon") WHERE `race` = "Amazons";
UPDATE teams SET `race` = REPLACE(`race`, "Chaos Dwarfs", "Chaos Dwarf") WHERE `race` = "Chaos Dwarfs";
UPDATE teams SET `race` = REPLACE(`race`, "Dark elves", "Dark Elf") WHERE `race` = "Dark elves";
UPDATE teams SET `race` = REPLACE(`race`, "Dwarfs", "Dwarf") WHERE `race` = "Dwarfs";
UPDATE teams SET `race` = REPLACE(`race`, "Elves", "Elf") WHERE `race` = "Elves";
UPDATE teams SET `race` = REPLACE(`race`, "Goblins", "Goblin") WHERE `race` = "Goblins";
UPDATE teams SET `race` = REPLACE(`race`, "Halflings", "Halfling") WHERE `race` = "Halflings";
UPDATE teams SET `race` = REPLACE(`race`, "High Elves", "High Elf") WHERE `race` = "High Elves";
UPDATE teams SET `race` = REPLACE(`race`, "Humans", "Human") WHERE `race` = "Humans";
UPDATE teams SET `race` = REPLACE(`race`, "Lizardmen", "Lizardman") WHERE `race` = "Lizardmen";
UPDATE teams SET `race` = REPLACE(`race`, "Orcs", "Orc") WHERE `race` = "Orcs";
UPDATE teams SET `race` = REPLACE(`race`, "Necromantics", "Necromantic") WHERE `race` = "Necromantics";
UPDATE teams SET `race` = REPLACE(`race`, "Nurgles", "Nurgle") WHERE `race` = "Nurgles";
UPDATE teams SET `race` = REPLACE(`race`, "Ogres", "Ogre") WHERE `race` = "Ogres";
UPDATE teams SET `race` = REPLACE(`race`, "Vampires", "Vampire") WHERE `race` = "Vampires";
UPDATE teams SET `race` = REPLACE(`race`, "Wood Elves", "Wood Elf") WHERE `race` = "Wood Elves";
ALTER TABLE players DROP date_retired;
ALTER TABLE players ADD COLUMN type TINYINT UNSIGNED DEFAULT 1 AFTER player_id;
UPDATE players SET type = 2 WHERE date_bought = 0;
UPDATE
(players
LEFT JOIN
(SELECT f_player_id AS 'pid', MIN(date_played) AS 'date' FROM matches, match_data WHERE f_match_id = match_id GROUP BY f_player_id) AS FMD
ON FMD.pid = players.player_id)
SET players.date_bought = IF(FMD.date IS NULL, NOW(), SUBTIME(FMD.date,'0 0:0:10')) WHERE players.type = 2;
ALTER TABLE texts ADD INDEX idx_f_id (f_id);
ALTER TABLE texts ADD INDEX idx_type (type);
ALTER TABLE players ADD INDEX idx_owned_by_team_id (owned_by_team_id);
ALTER TABLE teams ADD INDEX idx_owned_by_coach_id (owned_by_coach_id);
ALTER TABLE matches ADD INDEX idx_f_tour_id (f_tour_id);
ALTER TABLE matches ADD INDEX idx_team1_id_team2_id (team1_id,team2_id);
ALTER TABLE matches ADD INDEX idx_team2_id (team2_id);
ALTER TABLE match_data ADD INDEX idx_m (f_match_id);
ALTER TABLE match_data ADD INDEX idx_tr (f_tour_id);
ALTER TABLE match_data ADD INDEX idx_p_m (f_player_id,f_match_id);
ALTER TABLE match_data ADD INDEX idx_t_m (f_team_id, f_match_id);
ALTER TABLE match_data ADD INDEX idx_c_m (f_coach_id, f_match_id);
ALTER TABLE match_data ADD INDEX idx_p_tr (f_player_id,f_tour_id);
ALTER TABLE match_data ADD INDEX idx_t_tr (f_team_id, f_tour_id);
ALTER TABLE match_data ADD INDEX idx_c_tr (f_coach_id, f_tour_id);
ALTER TABLE tours ADD COLUMN rs TINYINT UNSIGNED DEFAULT 1 AFTER date_created;
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0.35 -> 0.36
Replace all OBBLM files.
Save your old folder "player_pics", you will need to re-upload all player pictures after upgrading.
Execute the following MySQL queries:
RENAME TABLE messages TO texts;
ALTER TABLE texts CHANGE COLUMN msg_id txt_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE texts CHANGE COLUMN f_coach_id f_id MEDIUMINT UNSIGNED;
ALTER TABLE texts CHANGE COLUMN date_posted date DATETIME;
ALTER TABLE texts CHANGE COLUMN title txt2 TEXT;
ALTER TABLE texts CHANGE COLUMN message txt TEXT;
ALTER TABLE texts ADD COLUMN type TINYINT UNSIGNED AFTER txt_id;
UPDATE texts SET type = 1;
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0.34 -> 0.35
Replace all OBBLM files and execute the following MySQL queries:
UPDATE teams SET race="Halflings" WHERE race="Haflings";
UPDATE players SET position="Halfling" WHERE position="Hafling";
Also, you will have to manually edit your database's "players" table, so that each player who has the incorrect spelled skill "Dirt player" has this skill corrected to "Dirty player" instead.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0.32, 0.33 -> 0.34
Replace all OBBLM files.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0.31 -> 0.32
Replace all OBBLM files.
NOTE: There is NO backwards compatibility for knock-out tournaments!
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0.3 -> 0.31
Replace all OBBLM files.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0.2 -> 0.3:
To upgrade from v. 0.2 to 0.3, replace all of your OBBLM PHP-files with the files from the new version, and execute the following MySQL queries:
UPDATE players SET extra_spp = 0 WHERE extra_spp IS NULL;
ALTER TABLE teams ADD fan_factor MEDIUMINT UNSIGNED AFTER rerolls;
UPDATE teams SET fan_factor = 0 WHERE fan_factor IS NULL;
ALTER TABLE tours DROP COLUMN date_finished;