diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/schema.sql | 1 | ||||
-rw-r--r-- | db/schema_0035-bodies_str-tidying.sql | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/db/schema.sql b/db/schema.sql index 609a1445d..5d42d57cf 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -132,6 +132,7 @@ create table problem ( latitude double precision not null, longitude double precision not null, bodies_str text, -- the body(s) we'll report this problem to + bodies_missing text, -- the body(s) we had no contact details for areas text not null, -- the mapit areas this location is in category text not null default 'Other', title text not null, diff --git a/db/schema_0035-bodies_str-tidying.sql b/db/schema_0035-bodies_str-tidying.sql new file mode 100644 index 000000000..c4c7badaf --- /dev/null +++ b/db/schema_0035-bodies_str-tidying.sql @@ -0,0 +1,10 @@ +begin; + +alter table problem add bodies_missing text; + +update problem + set bodies_missing = split_part(bodies_str, '|', 2), + bodies_str = split_part(bodies_str, '|', 1) + where bodies_str like '%|%'; + +commit; |