Is this because there's attachments present with a NULL type?  If so should we fix them to the correct type and put a DB constraint on the column instead?