Doctrine2 conversion error

后端 未结 4 1384
名媛妹妹
名媛妹妹 2021-02-02 08:14

What does this error from \"Doctrine2 & Symfony2\" mean?

Could not convert database value \"\" to Doctrine Type array

4条回答
  •  既然无缘
    2021-02-02 08:25

    You probably changed a field from type string to type array in your entity but already have data the database. It's failing at trying to convert an empty string from the database to an array.

    If it's a development database, simply delete it and create it again, or just delete the offending rows. Or you could convert all the empty strings to a:0:{} (a serialized empty array).

    UPDATE table SET column="a:0:{}" WHERE column = "";
    

提交回复
热议问题