Answer the question
In order to leave comments, you need to log in
How to set string data type for Postgresql in yii2 without character limit?
Hello. If I create a table through migrations specifying the string() data type, then Postgres creates a column with the character varying(255) type, and I need it to be just character varying without a length limit. How can this be achieved? You can, of course, write text() instead of string(), but then the column type will be exactly text, and I need to create character varying. Thank you.
public function safeUp()
{
$this->createTable('ad', [
'id' => $this->primaryKey(),
'name' => $this->string()->notNull(),
'created_at' => $this->integer()->notNull(),
'updated_at' => $this->integer()->notNull()
]);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question