Use clone instead of `unserialize(serialize`. Added another test that proves that 'onDelete=setnull' works, too.