From 246303b1e234fbde17775054859af4d6fe7e4a80 Mon Sep 17 00:00:00 2001
From: Struan Donald <struan@exo.org.uk>
Date: Mon, 19 Mar 2012 18:07:01 +0000
Subject: add external id to comments table

---
 db/schema.sql | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'db/schema.sql')

diff --git a/db/schema.sql b/db/schema.sql
index 395d1c07b..d54cecd5a 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -303,9 +303,10 @@ create table comment (
         or problem_state = 'fixed'
         or problem_state = 'fixed - council'
         or problem_state = 'fixed - user'
-    )
+    ),
     -- other fields? one to indicate whether this was written by the council
     -- and should be highlighted in the display?
+    external_id text
 );
 
 create index comment_user_id_idx on comment(user_id);
-- 
cgit v1.2.3


From 420c6becdb08d90da03f222a492893cd993772a1 Mon Sep 17 00:00:00 2001
From: Struan Donald <struan@exo.org.uk>
Date: Thu, 22 Mar 2012 17:34:29 +0000
Subject: add in send method code

---
 db/schema.sql | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'db/schema.sql')

diff --git a/db/schema.sql b/db/schema.sql
index d54cecd5a..ab323ee1a 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -420,5 +420,6 @@ create table open311conf (
     area_id      integer not null unique,
     endpoint     text not null,
     jurisdiction text,
-    api_key      text
+    api_key      text,
+    send_method  text
 );
-- 
cgit v1.2.3


From 832ee711e4b741196146b0218678d34849aa82ff Mon Sep 17 00:00:00 2001
From: Struan Donald <struan@exo.org.uk>
Date: Thu, 22 Mar 2012 17:38:09 +0000
Subject: add in retry count code

---
 db/schema.sql | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'db/schema.sql')

diff --git a/db/schema.sql b/db/schema.sql
index ab323ee1a..d9faa4aac 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -189,7 +189,12 @@ create table problem (
     send_questionnaire boolean not null default 't',
     extra text, -- extra fields required for open311
     flagged boolean not null default 'f',
-    geocode bytea
+    geocode bytea,
+    
+    -- logging sending failures (used by webservices)
+    send_fail_count integer not null default 0, 
+    send_fail_reason text, 
+    send_fail_timestamp timestamp
 );
 create index problem_state_latitude_longitude_idx on problem(state, latitude, longitude);
 create index problem_user_id_idx on problem ( user_id );
-- 
cgit v1.2.3


From 380b68fac937381221b7a90055ee1b5d64ab96e6 Mon Sep 17 00:00:00 2001
From: Struan Donald <struan@exo.org.uk>
Date: Fri, 23 Mar 2012 14:58:43 +0000
Subject: forgot to add extra column into schema file

---
 db/schema.sql | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'db/schema.sql')

diff --git a/db/schema.sql b/db/schema.sql
index d9faa4aac..aa008ce02 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -311,7 +311,8 @@ create table comment (
     ),
     -- other fields? one to indicate whether this was written by the council
     -- and should be highlighted in the display?
-    external_id text
+    external_id text,
+    extra text
 );
 
 create index comment_user_id_idx on comment(user_id);
-- 
cgit v1.2.3


From 36be8fa66e593a53cce4199d1fbb4fcb78452bbe Mon Sep 17 00:00:00 2001
From: Struan Donald <struan@exo.org.uk>
Date: Mon, 26 Mar 2012 13:01:45 +0100
Subject: DB changes for comment sending

---
 db/schema.sql | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'db/schema.sql')

diff --git a/db/schema.sql b/db/schema.sql
index aa008ce02..74b2eade6 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -312,7 +312,11 @@ create table comment (
     -- other fields? one to indicate whether this was written by the council
     -- and should be highlighted in the display?
     external_id text,
-    extra text
+    extra text,
+    send_fail_count integer not null default 0,
+    send_fail_reason text,
+    send_fail_timestamp timestamp,
+    whensent timestamp
 );
 
 create index comment_user_id_idx on comment(user_id);
@@ -427,5 +431,6 @@ create table open311conf (
     endpoint     text not null,
     jurisdiction text,
     api_key      text,
-    send_method  text
+    send_method  text,
+    send_comments boolean not null default 'f'
 );
-- 
cgit v1.2.3


From 23f700258100bfc42c8b07c251f8582399824409 Mon Sep 17 00:00:00 2001
From: Struan Donald <struan@exo.org.uk>
Date: Mon, 26 Mar 2012 17:34:50 +0100
Subject: associated a comment user with a council config

---
 db/schema.sql | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'db/schema.sql')

diff --git a/db/schema.sql b/db/schema.sql
index 74b2eade6..169939315 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -432,5 +432,6 @@ create table open311conf (
     jurisdiction text,
     api_key      text,
     send_method  text,
-    send_comments boolean not null default 'f'
+    send_comments boolean not null default 'f',
+    comment_user_id int references users(id)
 );
-- 
cgit v1.2.3


From 4b08e5136db27ab0d69d070e77dcd92193f86752 Mon Sep 17 00:00:00 2001
From: Struan Donald <struan@exo.org.uk>
Date: Tue, 1 May 2012 19:17:38 +0100
Subject: store title in users table so we can persist it for bromley

---
 db/schema.sql | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'db/schema.sql')

diff --git a/db/schema.sql b/db/schema.sql
index 169939315..cf70cef5c 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -135,7 +135,8 @@ create table users (
     phone           text,
     password        text    not null default '',
     from_council    integer, -- id of council user is from or null/0 if not
-    flagged         boolean not null default 'f'
+    flagged         boolean not null default 'f',
+    title           text
 );
 
 -- Problems reported by users of site
-- 
cgit v1.2.3


From 5accaad402d24f37851d8b85084fda2859b1ae16 Mon Sep 17 00:00:00 2001
From: Struan Donald <struan@exo.org.uk>
Date: Fri, 11 May 2012 13:17:27 +0100
Subject: add ability to suppress alerts to report creator on comments updated
 from open311

---
 db/schema.sql | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'db/schema.sql')

diff --git a/db/schema.sql b/db/schema.sql
index cf70cef5c..13f992749 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -434,5 +434,6 @@ create table open311conf (
     api_key      text,
     send_method  text,
     send_comments boolean not null default 'f',
-    comment_user_id int references users(id)
+    comment_user_id int references users(id),
+    suppress_alerts boolean not null default 'f'
 );
-- 
cgit v1.2.3

