-- 0005_chat_device: tag every chat message with a short deviceID/client identifier -- (DevDocs/design/16 ยง4.5). deviceID is the concrete client (browser/app/IM channel -- binding) that produced the message, complementing `platform` which only names -- the platform. It lets the agent know exactly HOW the owner is chatting (e.g. -- "web:chrome:a1b2c3" for a browser, "weixin-ilink:conf0:wx_uid_123" for IM). -- -- The 0004 chat_messages table already exists at this point, so ALTER ADD COLUMN is -- the correct, non-destructive step. ALTER TABLE chat_messages ADD COLUMN device_id TEXT NOT NULL DEFAULT '';