mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-10 09:28:06 +00:00
feat: convert character ids to 64 bits (#1878)
* feat: convert character ids to 64 bits remove all usages of the PERSISTENT bit with regards to storing of playerIDs on the server. the bit does not exist and was a phantom in the first place. Tested that a full playthrough of ag, ns and gf was still doable. slash commands work, ugc works, friends works, ignore list works, properties work and have names, teaming works. migrating an old mysql database works . need to test an old sqlite database * fix sqlite migration * remove nd specific column migration
This commit is contained in:
22
migrations/dlu/mysql/23_store_character_id_as_objectid.sql
Normal file
22
migrations/dlu/mysql/23_store_character_id_as_objectid.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
START TRANSACTION;
|
||||
ALTER TABLE mail MODIFY COLUMN sender_id BIGINT NOT NULL;
|
||||
ALTER TABLE bug_reports MODIFY COLUMN reporter_id BIGINT;
|
||||
/* This is done to prevent all entries on the leaderboard from updating */
|
||||
ALTER TABLE leaderboard CHANGE last_played last_played TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP();
|
||||
SET foreign_key_checks = 0;
|
||||
UPDATE activity_log SET character_id = character_id | 0x1000000000000000;
|
||||
UPDATE behaviors SET character_id = character_id | 0x1000000000000000;
|
||||
UPDATE bug_reports SET reporter_id = reporter_id | 0x1000000000000000;
|
||||
UPDATE charinfo SET id = id | 0x1000000000000000;
|
||||
UPDATE charxml SET id = id | 0x1000000000000000;
|
||||
UPDATE command_log SET character_id = character_id | 0x1000000000000000;
|
||||
UPDATE friends SET player_id = player_id | 0x1000000000000000, friend_id = friend_id | 0x1000000000000000;
|
||||
UPDATE ignore_list SET player_id = player_id | 0x1000000000000000, ignored_player_id = ignored_player_id | 0x1000000000000000;
|
||||
UPDATE leaderboard SET character_id = character_id | 0x1000000000000000;
|
||||
UPDATE mail SET sender_id = sender_id | 0x1000000000000000, receiver_id = receiver_id | 0x1000000000000000;
|
||||
UPDATE properties SET owner_id = owner_id | 0x1000000000000000;
|
||||
UPDATE ugc SET character_id = character_id | 0x1000000000000000;
|
||||
UPDATE ugc_modular_build SET character_id = character_id | 0x1000000000000000;
|
||||
SET foreign_key_checks = 1;
|
||||
ALTER TABLE leaderboard CHANGE last_played last_played TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP();
|
||||
COMMIT;
|
22
migrations/dlu/sqlite/6_store_character_id_as_objectid.sql
Normal file
22
migrations/dlu/sqlite/6_store_character_id_as_objectid.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
ALTER TABLE mail ADD COLUMN sender_id_1 BIGINT DEFAULT 0;
|
||||
ALTER TABLE bug_reports ADD COLUMN reporter_id_1 BIGINT DEFAULT 0;
|
||||
/* The leaderboard last_played change is not needed here since sqlite does not have ON UPDATE */
|
||||
UPDATE activity_log SET character_id = character_id | 0x1000000000000000;
|
||||
UPDATE behaviors SET character_id = character_id | 0x1000000000000000;
|
||||
UPDATE bug_reports SET reporter_id_1 = reporter_id | 0x1000000000000000;
|
||||
UPDATE charinfo SET id = id | 0x1000000000000000;
|
||||
UPDATE charxml SET id = id | 0x1000000000000000;
|
||||
UPDATE command_log SET character_id = character_id | 0x1000000000000000;
|
||||
UPDATE friends SET player_id = player_id | 0x1000000000000000, friend_id = friend_id | 0x1000000000000000;
|
||||
UPDATE ignore_list SET player_id = player_id | 0x1000000000000000, ignored_player_id = ignored_player_id | 0x1000000000000000;
|
||||
UPDATE leaderboard SET character_id = character_id | 0x1000000000000000;
|
||||
UPDATE mail SET sender_id_1 = sender_id | 0x1000000000000000, receiver_id = receiver_id | 0x1000000000000000;
|
||||
UPDATE properties SET owner_id = owner_id | 0x1000000000000000;
|
||||
UPDATE ugc SET character_id = character_id | 0x1000000000000000;
|
||||
UPDATE ugc_modular_build SET character_id = character_id | 0x1000000000000000;
|
||||
|
||||
ALTER TABLE mail DROP COLUMN sender_id;
|
||||
ALTER TABLE mail RENAME COLUMN sender_id_1 TO sender_id;
|
||||
|
||||
ALTER TABLE bug_reports DROP COLUMN reporter_id;
|
||||
ALTER TABLE bug_reports RENAME COLUMN reporter_id_1 TO reporter_id;
|
Reference in New Issue
Block a user