Database script cleaning