Modified the script to use a data directory for the database