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>
This commit is contained in:
Werner
2024-01-08 22:42:47 +00:00
committed by GitHub
co-authored by Werner
parent e0acdf9f73
commit 6287f394d3
3 changed files with 52 additions and 2 deletions
@@ -0,0 +1,9 @@
--
-- 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;