Answer the question
In order to leave comments, you need to log in
How to create an enum field in Yii2 in migration?
$this->createTable('credit_cards', [
'id' => 'pk',
'title' => Schema::TYPE_STRING . ' NOT NULL',
'content' => Schema::TYPE_TEXT,
]);
Answer the question
In order to leave comments, you need to log in
I suffered so much until I found it, now on yii2 (Apache-2.4 | PHP-5.5 | MySQL-5.5) it is relevant like this:
'status' => "enum('" . active . "','" . inactive . "') NOT NULL DEFAULT '" . active . "'",
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question