summaryrefslogtreecommitdiff
path: root/database
diff options
context:
space:
mode:
authorhorus2020-07-26 19:53:04 +0200
committerhorus2020-07-26 19:53:04 +0200
commit14ffa8c832cf69fde25d1ea3641b179ac2d77c03 (patch)
tree4ab6730f2a34c086e3cecf73de409da064b218c1 /database
parent04f8179f580b507d14039e9696d33744a064d577 (diff)
downloadsenpai-14ffa8c832cf69fde25d1ea3641b179ac2d77c03.tar.gz
Bugfix + seasons.
Diffstat (limited to 'database')
-rw-r--r--database/migrations/2020_07_23_185334_add_airing_status_to_view_anime.php5
1 files changed, 3 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 aa99e08..67f46ab 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
@@ -25,10 +25,11 @@ class AddAiringStatusToViewAnime extends Migration
a.created_at,
a.updated_at,
episodes,
- is_airing,
synopsis,
hashtag,
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 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,
@@ -41,7 +42,7 @@ class AddAiringStatusToViewAnime extends Migration
score IS NOT null
ORDER BY
abs(score_today-score_begin) DESC,
- is_airing DESC
+ airing_status ASC
;"
);
}