migration fixes for postgressql