aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2013-01-04 10:07:01 +0000
committerMatthew Somerville <matthew@mysociety.org>2013-01-04 10:07:01 +0000
commita25c9af807346f917434f039afc6b1fdf007d22a (patch)
treefc2896ee235a66534ebf850e2f8da38c2309fee2 /bin
parent6c4dfdb0048ed33384e0582164b5d8f4b51e752e (diff)
Fix warning due to use of confirmed column on Zurich when not all will have that set.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/update-all-reports9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/update-all-reports b/bin/update-all-reports
index e9edae0af..2ede68fe0 100755
--- a/bin/update-all-reports
+++ b/bin/update-all-reports
@@ -18,6 +18,13 @@ use List::MoreUtils qw(zip);
my $fourweeks = 4*7*24*60*60;
+# Age problems from when they're confirmed, except on Zurich
+# where they appear as soon as they're created.
+my $age_column = 'confirmed';
+if ( FixMyStreet->config('BASE_URL') =~ /zurich/ ) {
+ $age_column = 'created';
+}
+
my $problems = FixMyStreet::App->model("DB::Problem")->search(
{
state => [ FixMyStreet::DB::Result::Problem->visible_states() ],
@@ -26,7 +33,7 @@ my $problems = FixMyStreet::App->model("DB::Problem")->search(
columns => [
'id', 'bodies_str', 'state', 'areas',
{ duration => { extract => "epoch from current_timestamp-lastupdate" } },
- { age => { extract => "epoch from current_timestamp-confirmed" } },
+ { age => { extract => "epoch from current_timestamp-$age_column" } },
]
}
);