connected topic and reply tables to database