diff options
author | Yorhel <git@yorhel.nl> | 2010-02-02 18:33:51 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2010-02-02 18:33:51 +0100 |
commit | 1c0c4477f76dee105274aab7efe58b4381533b80 (patch) | |
tree | 39becf82b0c38ace8012697c1c7021350c56f437 /lib/Multi/RG.pm | |
parent | 3dc88eb0b242a1e26f7e6884d20fa63d30f5aab3 (diff) |
SQL: Converted language columns to an ENUM type
And changed vn.c_languages to an array type while I was at it. This
required some changes in the Perl code, and I found a bug in DBD::Pg
while I was at it:
https://rt.cpan.org/Ticket/Display.html?id=54224
Luckily, there's an easy workaround for that.
Diffstat (limited to 'lib/Multi/RG.pm')
-rw-r--r-- | lib/Multi/RG.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Multi/RG.pm b/lib/Multi/RG.pm index 76408d92..d72bb516 100644 --- a/lib/Multi/RG.pm +++ b/lib/Multi/RG.pm @@ -97,7 +97,7 @@ sub getrel { # num, res, id if(!grep !$_, values %{$_[HEAP]{nodes}}) { my $ids = join(', ', map '?', keys %{$_[HEAP]{nodes}}); $_[KERNEL]->post(pg => query => $_[HEAP]{type} eq 'v' - ? "SELECT v.id, vr.title, v.c_released AS date, v.c_languages AS lang FROM vn v JOIN vn_rev vr ON vr.id = v.latest WHERE v.id IN($ids) ORDER BY v.c_released" + ? "SELECT v.id, vr.title, v.c_released AS date, v.c_languages::text[] AS lang FROM vn v JOIN vn_rev vr ON vr.id = v.latest WHERE v.id IN($ids) ORDER BY v.c_released" : "SELECT p.id, pr.name, pr.lang, pr.type FROM producers p JOIN producers_rev pr ON pr.id = p.latest WHERE p.id IN($ids) ORDER BY pr.name", [ keys %{$_[HEAP]{nodes}} ], 'builddot'); } @@ -252,7 +252,7 @@ sub _vnnode { q|<TR><TD COLSPAN="2" ALIGN="CENTER" CELLPADDING="2"><FONT POINT-SIZE="%d"> %s </FONT></TD></TR>|. q|<TR><TD> %s </TD><TD> %s </TD></TR>|. qq|</TABLE>> ]\n|, - $_->{id}, encode_utf8($tooltip), $heap->{fsize}[2], encode_utf8($title), $date, $n->{lang}||'N/A'; + $_->{id}, encode_utf8($tooltip), $heap->{fsize}[2], encode_utf8($title), $date, join('/', @{$n->{lang}})||'N/A'; } |