mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-25 06:57:28 +00:00
Update sql to work
The old way was supposed to work but doesn't. Oh well!
This commit is contained in:
parent
59d7121978
commit
96fc6e81d8
@ -287,7 +287,7 @@ std::string FormatInsert(const Leaderboard::Type& type, const Score& score, cons
|
|||||||
constexpr uint16_t STRING_LENGTH = 400;
|
constexpr uint16_t STRING_LENGTH = 400;
|
||||||
// Then fill in our score
|
// Then fill in our score
|
||||||
char finishedQuery[STRING_LENGTH];
|
char finishedQuery[STRING_LENGTH];
|
||||||
int32_t res = snprintf(finishedQuery, STRING_LENGTH, insertStatement.c_str(), score.GetPrimaryScore(), score.GetSecondaryScore(), score.GetTertiaryScore());
|
[[maybe_unused]] int32_t res = snprintf(finishedQuery, STRING_LENGTH, insertStatement.c_str(), score.GetPrimaryScore(), score.GetSecondaryScore(), score.GetTertiaryScore());
|
||||||
DluAssert(res != -1);
|
DluAssert(res != -1);
|
||||||
return finishedQuery;
|
return finishedQuery;
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,8 @@ ALTER TABLE leaderboard
|
|||||||
/* Can only ALTER one column at a time... */
|
/* Can only ALTER one column at a time... */
|
||||||
ALTER TABLE leaderboard
|
ALTER TABLE leaderboard
|
||||||
CHANGE last_played last_played TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP();
|
CHANGE last_played last_played TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP();
|
||||||
ALTER TABLE leaderboard RENAME COLUMN score TO primaryScore;
|
ALTER TABLE leaderboard CHANGE score primaryScore FLOAT NOT NULL DEFAULT 0;
|
||||||
ALTER TABLE leaderboard RENAME COLUMN time TO secondaryScore;
|
ALTER TABLE leaderboard CHANGE time secondaryScore FLOAT NOT NULL DEFAULT 0 AFTER primaryScore;
|
||||||
ALTER TABLE leaderboard MODIFY COLUMN secondaryScore FLOAT NOT NULL DEFAULT 0 AFTER primaryScore;
|
|
||||||
ALTER TABLE leaderboard MODIFY COLUMN primaryScore FLOAT NOT NULL DEFAULT 0;
|
|
||||||
|
|
||||||
/* A bit messy, but better than going through a bunch of code fixes all to be run once. */
|
/* A bit messy, but better than going through a bunch of code fixes all to be run once. */
|
||||||
UPDATE leaderboard SET
|
UPDATE leaderboard SET
|
||||||
|
Loading…
Reference in New Issue
Block a user