-- read_at timestamp для галочек "прочитано"
ALTER TABLE messages ADD COLUMN IF NOT EXISTS read_at TIMESTAMPTZ;
UPDATE messages SET read_at = updated_at WHERE read = TRUE AND read_at IS NULL;