pre-db migrate all psql to python