database ready for move to the iMac

database backend is now setup for PostgreSQL
updated schema
updated queries