Wrote a script to migrate postgresql databases