Fixed migration to work with postgres