summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2022-04-19 12:19:03 +0200
committerYorhel <git@yorhel.nl>2022-04-19 12:20:04 +0200
commit51b2fffea346bd35cb079bce5e22f4728a244c18 (patch)
tree8e1837c0e0192e34e4b9b53058878024b63dd1de
parentdec80df43d0f6b874c3a21345534859f4b09a4c7 (diff)
SQL: Adjust default VN popularity rank to 10M
So that new VNs will be ranked as least popular (with 0 votes). The daily update_vnvotestats() cron will update the value with something more sensible. Fixes https://vndb.org/t950.1219
-rw-r--r--sql/schema.sql2
-rw-r--r--util/updates/2022-04-19-vn-default-poprank.sql1
2 files changed, 2 insertions, 1 deletions
diff --git a/sql/schema.sql b/sql/schema.sql
index 034decf8..903b00ce 100644
--- a/sql/schema.sql
+++ b/sql/schema.sql
@@ -1097,7 +1097,7 @@ CREATE TABLE vn ( -- dbentry_type=v
l_wikidata integer, -- [pub]
c_votecount integer NOT NULL DEFAULT 0, -- [pub]
c_popularity smallint NOT NULL DEFAULT 0, -- [pub], ratio between 0 and 10000
- c_pop_rank integer NOT NULL DEFAULT 0,
+ c_pop_rank integer NOT NULL DEFAULT 10000000,
c_rating smallint, -- [pub], decimal vote*100, i.e. 100 - 1000
c_rat_rank integer,
c_released integer NOT NULL DEFAULT 0,
diff --git a/util/updates/2022-04-19-vn-default-poprank.sql b/util/updates/2022-04-19-vn-default-poprank.sql
new file mode 100644
index 00000000..080269e2
--- /dev/null
+++ b/util/updates/2022-04-19-vn-default-poprank.sql
@@ -0,0 +1 @@
+ALTER TABLE vn ALTER COLUMN c_pop_rank SET DEFAULT 10000000;