updated database build script