[NUUG fiksgatami] New fixmystreet database layout break Norwegian site
Matthew Somerville
matthew at mysociety.org
Tue Apr 19 13:49:53 CEST 2011
Hi Petter,
When we deploy our site, it checks that the database matches the
contents of the db/schema.sql file; if not, it errors, so that we can't
deploy a site that's not up-to-date with respect to the schema.
In this instance, you need to add the three columns recently added to
schema.sql:
+ -- External information
+ external_id text,
+ external_body text,
+ external_team text,
We will probably need to look at better schema updating in future for
things like this - thankfully, the move to Catalyst will help with that,
and sorry for inconvenience in the mean time.
ATB,
Matthew
On 18/04/2011 22:21, Petter Reinholdtsen wrote:
> Updating to the latest git version of the FixMyStreet source break the
> showing of problem reports on Norwegian site. This patch "solve" it,
> by reverting to the old database layout before commit
> 960c1838721cf1f4366fb5c7600aa50b0c9e0c51.
>
> What is the correct fix to be able to use the latest version of the
> source?
>
> diff --git a/perllib/Problems.pm b/perllib/Problems.pm
> index 7155aa4..3710c3a 100644
> --- a/perllib/Problems.pm
> +++ b/perllib/Problems.pm
> @@ -226,7 +226,7 @@ sub fetch_problem {
> used_map, name, anonymous, extract(epoch from confirmed) as time,
> state, extract(epoch from whensent-confirmed) as whensent,
> extract(epoch from ms_current_timestamp()-lastupdate) as duration,
> - service, cobrand, cobrand_data, external_body
> + service, cobrand, cobrand_data
> from problem where id=? and state in ('confirmed','fixed', 'hidden')
> $site_restriction", {}, $id
> );
>
> Happy hacking,
More information about the fiksgatami
mailing list