aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatthew <matthew>2007-06-18 15:31:00 +0000
committermatthew <matthew>2007-06-18 15:31:00 +0000
commit28bf5436002c5f909b9bfad6eaf34940815d4976 (patch)
treee3bf16b1c74a70eed097b956af28e73a538bbd8f
parent2740cdca3b46d0508402664510a942ed0d23a3ca (diff)
Stick problem_id in flickr_imported table too.
-rwxr-xr-xbin/import-flickr4
-rw-r--r--db/schema.sql5
2 files changed, 5 insertions, 4 deletions
diff --git a/bin/import-flickr b/bin/import-flickr
index 126987721..67c0cd7d0 100755
--- a/bin/import-flickr
+++ b/bin/import-flickr
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: import-flickr,v 1.4 2007-06-18 14:27:55 matthew Exp $
+# $Id: import-flickr,v 1.5 2007-06-18 15:31:00 matthew Exp $
use strict;
require 5.8.0;
@@ -91,7 +91,7 @@ sub problem_create {
$s->bind_param(7, $image, { pg_type => DBD::Pg::PG_BYTEA });
$s->execute();
- dbh()->do('insert into flickr_imported (id) values (?)', {}, $photo_id);
+ dbh()->do('insert into flickr_imported (id, problem_id) values (?, ?)', {}, $photo_id, $id);
# XXX: Needs to only send email once to user per batch of photos, not one per photo?
my $template = File::Slurp::read_file("$FindBin::Bin/../templates/emails/flickr-submit");
diff --git a/db/schema.sql b/db/schema.sql
index c1513c05d..55eeaf4a0 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -4,7 +4,7 @@
-- Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
-- Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
--
--- $Id: schema.sql,v 1.34 2007-06-17 10:14:52 matthew Exp $
+-- $Id: schema.sql,v 1.35 2007-06-18 15:31:00 matthew Exp $
--
-- secret
@@ -289,6 +289,7 @@ create table flickr (
create unique index flickr_email_idx on flickr(email);
create table flickr_imported (
- id integer not null
+ id integer not null,
+ problem_id integer not null references problem(id)
);
create unique index flickr_imported_id_idx on flickr_imported(id);