Updated SQL script to work with postgresql and create schema.