-- Add admin_uuid to tbl_chat to track which admin sent messages
-- and enable per-message admin name display in admin chats.

ALTER TABLE tbl_chat
  ADD COLUMN admin_uuid VARCHAR(32) NULL AFTER admin_chat_div;

-- Optional but recommended index for lookups by admin or join
ALTER TABLE tbl_chat
  ADD INDEX idx_tbl_chat_admin_uuid (admin_uuid);

-- If you also want to optimize unread queries by admin status and user:
-- ALTER TABLE tbl_chat
--   ADD INDEX idx_chat_admin_del_user (admin_chat_div, delete_flg, user_uuid);

-- No data backfill is performed here since legacy rows do not store sender admin.
-- New messages will be stored with the current session admin_uuid.

