diff options
| author | horus | 2020-09-16 11:13:53 +0200 |
|---|---|---|
| committer | horus | 2020-09-16 11:13:53 +0200 |
| commit | a5ff13269db053896b604fc29181d60e208d0463 (patch) | |
| tree | a10820fcb0fba116ab0105ef1538d9a6f7069f4b /database | |
| parent | 98736ba280573b66eb3d5bf026ed943dc8ceb663 (diff) | |
| download | senpai-a5ff13269db053896b604fc29181d60e208d0463.tar.gz | |
Major improvement.
Diffstat (limited to 'database')
| -rw-r--r-- | database/migrations/2020_07_23_185334_add_airing_status_to_view_anime.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/database/migrations/2020_07_23_185334_add_airing_status_to_view_anime.php b/database/migrations/2020_07_23_185334_add_airing_status_to_view_anime.php index 67f46ab..330b489 100644 --- a/database/migrations/2020_07_23_185334_add_airing_status_to_view_anime.php +++ b/database/migrations/2020_07_23_185334_add_airing_status_to_view_anime.php @@ -19,8 +19,10 @@ class AddAiringStatusToViewAnime extends Migration a.mal_id, url, image_url, - title_pref as title, + (CASE WHEN title_eng IS NOT NULL THEN title_eng + ELSE title_pref END) as title, title_pref, + title_eng, anime_type, a.created_at, a.updated_at, @@ -30,7 +32,7 @@ class AddAiringStatusToViewAnime extends Migration airing_status, (SELECT season_name FROM stats as b WHERE b.mal_id = a.mal_id ORDER BY created_at ASC LIMIT 1) as season_name, (SELECT season_year FROM stats as b WHERE b.mal_id = a.mal_id ORDER BY created_at ASC LIMIT 1) as season_year, - (SELECT score FROM stats as b WHERE b.mal_id = a.mal_id ORDER BY created_at ASC LIMIT 1) as score_begin, + (SELECT score FROM stats as b WHERE b.mal_id = a.mal_id AND score IS NOT NULL ORDER BY created_at ASC LIMIT 1) as score_begin, (SELECT score FROM stats as b WHERE b.mal_id = a.mal_id ORDER BY created_at DESC LIMIT 1) as score_today, (SELECT watching FROM stats as b WHERE b.mal_id = a.mal_id ORDER BY created_at DESC LIMIT 1) as watching, (SELECT members FROM stats as b WHERE b.mal_id = a.mal_id ORDER BY created_at DESC LIMIT 1) as members |
