diff options
author | Yorhel <git@yorhel.nl> | 2022-02-05 08:27:33 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2022-02-05 08:31:03 +0100 |
commit | 9d651b8d138349b3853f23117cc3802fcfe0ba6a (patch) | |
tree | ba4193e2c04d2011ee8bc1f05814f6cf3d1f34c3 /util | |
parent | 182732799f7a526824df4c4002dcce82bf0a2f95 (diff) |
Count VNs without votes as popularity=0
As opposed to NULL, i.e. not having a popularity at all.
Fixes https://vndb.org/t2520.623 and https://vndb.org/t2520.624
Diffstat (limited to 'util')
-rw-r--r-- | util/updates/2022-02-05-popularity-non-null.sql | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/util/updates/2022-02-05-popularity-non-null.sql b/util/updates/2022-02-05-popularity-non-null.sql new file mode 100644 index 00000000..238d7867 --- /dev/null +++ b/util/updates/2022-02-05-popularity-non-null.sql @@ -0,0 +1,7 @@ +\i sql/func.sql +SELECT update_vnvotestats(); +ALTER TABLE vn + ALTER COLUMN c_popularity SET NOT NULL, + ALTER COLUMN c_pop_rank SET NOT NULL, + ALTER COLUMN c_popularity SET DEFAULT 0, + ALTER COLUMN c_pop_rank SET DEFAULT 0; |