diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-12-12 16:48:27 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-12-15 00:11:05 +0000 |
commit | fa4947c017af7599699892c1c3a647fc61f971ed (patch) | |
tree | 71cf677abe1891f40a79fa2a1e606929ad8f7640 /perllib/Open311 | |
parent | 07b07d90cf666a06cb071ceebcecbd21d91e6b60 (diff) |
Rename area_id on Contacts table to body_id.
Add foreign key constraint from contacts to body.
Diffstat (limited to 'perllib/Open311')
-rw-r--r-- | perllib/Open311/PopulateServiceList.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/perllib/Open311/PopulateServiceList.pm b/perllib/Open311/PopulateServiceList.pm index 8637e8431..65737d7c4 100644 --- a/perllib/Open311/PopulateServiceList.pm +++ b/perllib/Open311/PopulateServiceList.pm @@ -88,7 +88,7 @@ sub process_service { print $self->_current_service->{service_code} . ': ' . $category . "\n" if $self->verbose >= 2; my $contacts = FixMyStreet::App->model( 'DB::Contact')->search( { - area_id => $self->_current_council->area_id, + body_id => $self->_current_council->area_id, -OR => [ email => $self->_current_service->{service_code}, category => $category, @@ -168,7 +168,7 @@ sub _create_contact { $contact = FixMyStreet::App->model( 'DB::Contact')->create( { email => $self->_current_service->{service_code}, - area_id => $self->_current_council->area_id, + body_id => $self->_current_council->area_id, category => $service_name, confirmed => 1, deleted => 0, @@ -272,7 +272,7 @@ sub _delete_contacts_not_in_service_list { my $found_contacts = FixMyStreet::App->model( 'DB::Contact')->search( { email => { -not_in => $self->found_contacts }, - area_id => $self->_current_council->area_id, + body_id => $self->_current_council->area_id, deleted => 0, } ); |