From 951a6710d81449fca417d951a3e765db6b8f4b63 Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Thu, 18 Sep 2025 22:14:57 -0700 Subject: [PATCH] fix sqlite migration --- .../6_store_character_id_as_objectid.sql | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/migrations/dlu/sqlite/6_store_character_id_as_objectid.sql b/migrations/dlu/sqlite/6_store_character_id_as_objectid.sql index 8cbfdca5..84e74b6d 100644 --- a/migrations/dlu/sqlite/6_store_character_id_as_objectid.sql +++ b/migrations/dlu/sqlite/6_store_character_id_as_objectid.sql @@ -1,21 +1,23 @@ -START TRANSACTION; -ALTER TABLE mail MODIFY COLUMN sender_id BIGINT NOT NULL; -ALTER TABLE bug_reports MODIFY COLUMN reporter_id BIGINT; +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 */ -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 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 = sender_id | 0x1000000000000000, receiver_id = receiver_id | 0x1000000000000000; UPDATE pet_names SET owner_id = owner_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; -SET foreign_key_checks = 1; -COMMIT; + +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;