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:
David Markowitz
2025-09-18 23:12:23 -07:00
committed by GitHub
parent 68f2e2dee2
commit 6389876c6e
56 changed files with 327 additions and 270 deletions

View 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;