diff options
author | Yorhel <git@yorhel.nl> | 2014-10-13 10:24:01 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2014-10-13 10:24:01 +0200 |
commit | a1b4da1d3ae9e6ed9326df41f9831be81f6b839a (patch) | |
tree | f9a6aff31799cb4eaa5ddc133553b9cdf789bfbe /util/sql/func.sql | |
parent | 26506d2bd7543aea1a4f49634be8b9bf110ad57c (diff) |
SQL: Use enum to represent platforms
I believe I didn't do this conversion earlier (back when I converted the
language types) because PostgreSQL didn't support dynamically adding new
values to an existing enum back then, and modifying an enum was a huge
pain. Recent versions do support this, so there's no reason to keep it
as a string.
...I just felt like adding some churn to the code base.
Diffstat (limited to 'util/sql/func.sql')
-rw-r--r-- | util/sql/func.sql | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/util/sql/func.sql b/util/sql/func.sql index 3923ffb5..4bcc8d99 100644 --- a/util/sql/func.sql +++ b/util/sql/func.sql @@ -54,7 +54,7 @@ CREATE OR REPLACE FUNCTION update_vncache(integer) RETURNS void AS $$ GROUP BY rl2.lang ORDER BY rl2.lang ), - c_platforms = COALESCE(ARRAY_TO_STRING(ARRAY( + c_platforms = ARRAY( SELECT rp3.platform FROM releases_platforms rp3 JOIN releases_rev rr3 ON rp3.rid = rr3.id @@ -65,7 +65,8 @@ CREATE OR REPLACE FUNCTION update_vncache(integer) RETURNS void AS $$ AND rr3.released <= TO_CHAR('today'::timestamp, 'YYYYMMDD')::integer AND r3.hidden = FALSE GROUP BY rp3.platform - ORDER BY rp3.platform), '/'), '') + ORDER BY rp3.platform + ) WHERE id = $1; $$ LANGUAGE sql; |