Migrated to postgresql and updated tests