Issue #2051751 by hswong3i: message.mid is part of the primary key but is not specified to be not null.