aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-07-29 18:10:50 +0100
committerStruan Donald <struan@exo.org.uk>2011-07-29 18:10:50 +0100
commite7ccf3fe896a9f642306daff9a750f3c9a6b7cdd (patch)
treeeda3740a18a39a9a32ba9cb96417dba9c4720f04
parenta9b0f5199b2b028ab33d909f0a4121d368f0bd2f (diff)
open311conf id to type serial
-rw-r--r--db/schema.sql2
-rw-r--r--db/schema_0010-add_open311_conf.sql2
-rw-r--r--perllib/FixMyStreet/DB/Result/Open311conf.pm11
3 files changed, 10 insertions, 5 deletions
diff --git a/db/schema.sql b/db/schema.sql
index d4dbd76de..c3487cdc8 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -391,7 +391,7 @@ create table admin_log (
-- Record open 311 configuration details
create table open311conf (
- id integer primary key,
+ id serial primary key,
area_id integer not null unique,
endpoint text not null,
jurisdiction text,
diff --git a/db/schema_0010-add_open311_conf.sql b/db/schema_0010-add_open311_conf.sql
index 06667caf0..920272c05 100644
--- a/db/schema_0010-add_open311_conf.sql
+++ b/db/schema_0010-add_open311_conf.sql
@@ -1,7 +1,7 @@
begin;
CREATE TABLE open311conf (
- id INTEGER PRIMARY KEY,
+ id SERIAL PRIMARY KEY,
area_id INTEGER NOT NULL unique,
endpoint TEXT NOT NULL,
jurisdiction TEXT,
diff --git a/perllib/FixMyStreet/DB/Result/Open311conf.pm b/perllib/FixMyStreet/DB/Result/Open311conf.pm
index d7621e2c7..0a5784560 100644
--- a/perllib/FixMyStreet/DB/Result/Open311conf.pm
+++ b/perllib/FixMyStreet/DB/Result/Open311conf.pm
@@ -12,7 +12,12 @@ __PACKAGE__->load_components("FilterColumn", "InflateColumn::DateTime", "Encoded
__PACKAGE__->table("open311conf");
__PACKAGE__->add_columns(
"id",
- { data_type => "integer", is_nullable => 0 },
+ {
+ data_type => "integer",
+ is_auto_increment => 1,
+ is_nullable => 0,
+ sequence => "open311conf_id_seq",
+ },
"area_id",
{ data_type => "integer", is_nullable => 0 },
"endpoint",
@@ -26,8 +31,8 @@ __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
+# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-07-29 18:09:25
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ryqCpvwjNtQrZm4I3s0hxg
# You can replace this text with custom code or comments, and it will be preserved on regeneration