Files
Aurora.3/SQL/migrate-2023/V009__fix_death_saving_again.sql
Werner 6287f394d3 Fix Death Tracking again (#18181)
* Fixes SQL Death Tracking again

Removes the foreign key constraint from the ckeys.
-> Ckeys can have different values i.e. when someone dies while aghosted the ckey becomes @ckey

Ensurs that the char_id is set to null and not 0 -> To make sure the foreign key constraint there actually works

* Simpler changelog

---------

Co-authored-by: Werner <Arrow768@users.noreply.github.com>
2024-01-08 22:42:47 +00:00

10 lines
529 B
SQL

--
-- Fixes death saving again by removing the foreign key constraints on the ckeys. (sometimes chey can contain things that arnt ckeys. i.e. @ckey when someone aghosts)
--
ALTER TABLE `ss13_death`
DROP FOREIGN KEY `FK_ss13_death_ss13_characters`;
ALTER TABLE `ss13_death`
DROP FOREIGN KEY `FK_ss13_death_ss13_player`,
DROP FOREIGN KEY `FK_ss13_death_ss13_player_lackey`,
ADD CONSTRAINT `FK_ss13_death_ss13_characters_char_id` FOREIGN KEY (`char_id`) REFERENCES `ss13_characters` (`id`) ON UPDATE CASCADE ON DELETE SET NULL;