Moved models to postgres
Fixed postgresql implementation