update dbutil add fun to rewrite macro and update the sql script migrat