문제

I want a column in my database to be of type text (an unlimited amount of text).

In my schema:

bio: { type: text }

Migration file generated:

$this->changeColumn('organization', 'bio', 'text', '', array());

When I try to migrate I get the following error:

- SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1. Failing Query: "ALTER TABLE organization CHANGE bio bio text()"  

What is the correct syntax for such a field?

도움이 되었습니까?

해결책

Try to use "string" instead of "text"

bio: { type: string }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top