Add an unique index on msg_id