fix: define podcast_id and platform_slug as foreign keys in podcasts_plaforms table

update discord logo
This commit is contained in:
Yassine Doghri 2022-01-04 16:37:59 +00:00
commit 6e9451a110
9 changed files with 19 additions and 22 deletions

View file

@ -102,7 +102,7 @@ class PlatformModel extends Model
! ($found = cache("podcast#{$podcastId}_platforms_{$platformType}_withLinks"))
) {
$found = $this->select(
'platforms.*, podcasts_platforms.link_url, podcasts_platforms.link_content, podcasts_platforms.is_visible, podcasts_platforms.is_on_embed',
'platforms.*, podcasts_platforms.link_url, podcasts_platforms.account_id, podcasts_platforms.is_visible, podcasts_platforms.is_on_embed',
)
->join(
'podcasts_platforms',
@ -127,7 +127,7 @@ class PlatformModel extends Model
$cacheName = "podcast#{$podcastId}_platforms_{$platformType}";
if (! ($found = cache($cacheName))) {
$found = $this->select(
'platforms.*, podcasts_platforms.link_url, podcasts_platforms.link_content, podcasts_platforms.is_visible, podcasts_platforms.is_on_embed',
'platforms.*, podcasts_platforms.link_url, podcasts_platforms.account_id, podcasts_platforms.is_visible, podcasts_platforms.is_on_embed',
)
->join('podcasts_platforms', 'podcasts_platforms.platform_slug = platforms.slug')
->where('podcasts_platforms.podcast_id', $podcastId)