postgres script for 1.1.1 to 1.2migration and fixes to the previous one