Database migration for chats