okfn/ckan — pull request #706 by joetsoi (2013-03-27 13:10:34+00:00)
Title: 66-67 Data migration is broken

067_turn_extras_to_strings.py is currently broken due to okfn/ckan@7677d69e , this is an example from a dump of pdeu before the change, after the change and what query should be executing.

pdeu=# select count(id) from package_extra where left(value,1) = '"';
count
--------
274194
(1 row)

pdeu=# select count(id) from package_extra where substr(value,0,1) = '"';
count
-------
0
(1 row)

pdeu=# select count(id) from package_extra where substr(value,1,1) = '"';
count
--------
274194
(1 row)

substr counts from 1, see examples in [postgres docs](http://www.postgresql.org/docs/9.1/static/functions-string.html)