update chat, thread, add database