2023-04-17 22:19:13 +00:00
|
|
|
ALTER TABLE leaderboard
|
2023-06-01 06:04:33 +00:00
|
|
|
ADD COLUMN tertiaryScore FLOAT NOT NULL DEFAULT 0,
|
2023-04-17 22:19:13 +00:00
|
|
|
ADD COLUMN numWins INT NOT NULL DEFAULT 0,
|
2023-05-30 11:11:37 +00:00
|
|
|
ADD COLUMN timesPlayed INT NOT NULL DEFAULT 1,
|
|
|
|
MODIFY time INT NOT NULL DEFAULT 0;
|
2023-04-17 08:16:23 +00:00
|
|
|
|
2023-06-01 06:04:33 +00:00
|
|
|
/* Can only ALTER one column at a time... */
|
2023-06-05 09:24:00 +00:00
|
|
|
ALTER TABLE leaderboard CHANGE score primaryScore FLOAT NOT NULL DEFAULT 0;
|
|
|
|
ALTER TABLE leaderboard CHANGE time secondaryScore FLOAT NOT NULL DEFAULT 0 AFTER primaryScore;
|
2023-04-17 22:19:13 +00:00
|
|
|
|
2023-06-01 06:04:33 +00:00
|
|
|
/* A bit messy, but better than going through a bunch of code fixes all to be run once. */
|
|
|
|
UPDATE leaderboard SET
|
|
|
|
primaryScore = secondaryScore,
|
2024-03-30 13:18:03 +00:00
|
|
|
secondaryScore = 0 WHERE game_id IN (1, 44, 46, 47, 48, 49, 53, 103, 104, 108, 1901) AND secondaryScore > 0;
|
2023-06-22 04:46:11 +00:00
|
|
|
|
|
|
|
/* Do this last so we dont update entry times erroneously */
|
|
|
|
ALTER TABLE leaderboard
|
|
|
|
CHANGE last_played last_played TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP();
|