mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-04 22:07:52 +00:00
fix(Core/Petitions): re-key petition_sign on petition_id and fix type-filtered signature deletes (#26668)
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
-- petition_sign kept its (petitionguid, playerguid) primary key when the
|
||||
-- petition_id schema stopped writing petitionguid: every row inserts with
|
||||
-- petitionguid = 0, so the key collapses to (0, playerguid) and a character
|
||||
-- can never hold more than one signature row overall (later signs fail
|
||||
-- silently with a duplicate key on the async insert).
|
||||
-- Re-key on (petition_id, playerguid) and drop the signature rows orphaned
|
||||
-- by the type-filtered deletes that no longer match (`type` is not written
|
||||
-- by the insert either).
|
||||
DELETE `ps` FROM `petition_sign` `ps` LEFT JOIN `petition` `p` ON `p`.`petition_id` = `ps`.`petition_id` WHERE `p`.`petition_id` IS NULL;
|
||||
ALTER TABLE `petition_sign` DROP PRIMARY KEY, ADD PRIMARY KEY (`petition_id`, `playerguid`), DROP INDEX `idx_petition_id_player`;
|
||||
Reference in New Issue
Block a user