script to clean chat related tables