switch to  pg
fix migrate
migrate to postgresql and new json format