From: Daniel Karbach Date: Tue, 21 Feb 2023 14:44:52 +0000 (+0100) Subject: remove references before deleting episode X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=7d018a20dfb545cefb1f28627841d9995052c1f6;p=alttp.git remove references before deleting episode --- diff --git a/app/Console/Commands/SyncSpeedGaming.php b/app/Console/Commands/SyncSpeedGaming.php index 6d0fa1f..ce8b10c 100644 --- a/app/Console/Commands/SyncSpeedGaming.php +++ b/app/Console/Commands/SyncSpeedGaming.php @@ -87,6 +87,8 @@ class SyncSpeedGaming extends Command { ->where('start', '<=', $to) ->whereNotIn('ext_id', $ext_ids); foreach ($to_purge->get() as $episode) { + $episode->channels()->detach(); + $episode->crew()->delete(); $episode->players()->delete(); } $to_purge->delete();