aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-07-29 17:53:10 +0100
committerStruan Donald <struan@exo.org.uk>2011-07-29 17:53:10 +0100
commita9b0f5199b2b028ab33d909f0a4121d368f0bd2f (patch)
tree0df9b3216cd96a9190b22b8850ccaf0e2e8a7b01
parent2fb1d662ebc31eb54f129609899770c2811072eb (diff)
add in table to store configuration of councils using open311
-rw-r--r--db/schema.sql9
-rw-r--r--db/schema_0010-add_open311_conf.sql11
-rw-r--r--perllib/FixMyStreet/DB/Result/Open311conf.pm34
3 files changed, 54 insertions, 0 deletions
diff --git a/db/schema.sql b/db/schema.sql
index 37ffddd51..d4dbd76de 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -388,3 +388,12 @@ create table admin_log (
whenedited timestamp not null default ms_current_timestamp()
);
+-- Record open 311 configuration details
+
+create table open311conf (
+ id integer primary key,
+ area_id integer not null unique,
+ endpoint text not null,
+ jurisdiction text,
+ api_key text
+);
diff --git a/db/schema_0010-add_open311_conf.sql b/db/schema_0010-add_open311_conf.sql
new file mode 100644
index 000000000..06667caf0
--- /dev/null
+++ b/db/schema_0010-add_open311_conf.sql
@@ -0,0 +1,11 @@
+begin;
+
+CREATE TABLE open311conf (
+ id INTEGER PRIMARY KEY,
+ area_id INTEGER NOT NULL unique,
+ endpoint TEXT NOT NULL,
+ jurisdiction TEXT,
+ api_key TEXT
+);
+
+commit;
diff --git a/perllib/FixMyStreet/DB/Result/Open311conf.pm b/perllib/FixMyStreet/DB/Result/Open311conf.pm
new file mode 100644
index 000000000..d7621e2c7
--- /dev/null
+++ b/perllib/FixMyStreet/DB/Result/Open311conf.pm
@@ -0,0 +1,34 @@
+package FixMyStreet::DB::Result::Open311conf;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+__PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "EncodedColumn");
+__PACKAGE__->table("open311conf");
+__PACKAGE__->add_columns(
+ "id",
+ { data_type => "integer", is_nullable => 0 },
+ "area_id",
+ { data_type => "integer", is_nullable => 0 },
+ "endpoint",
+ { data_type => "text", is_nullable => 0 },
+ "jurisdiction",
+ { data_type => "text", is_nullable => 1 },
+ "api_key",
+ { data_type => "text", is_nullable => 1 },
+);
+__PACKAGE__->set_primary_key("id");
+__PACKAGE__->add_unique_constraint("open311conf_area_id_key", ["area_id"]);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-07-29 17:47:55
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:e7DwO1HQwldHk/94RvQj6A
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;