Fix test failures due to not null constraint on attachments ordering