bugfix for postgres migration