fix db migrate

See:
https://www.chiliproject.org/issues/1164