Migration to Postgresql from sqlite3