Database script cleanup and preparation script