7
我使字段ENUM和結果是錯誤時,我在CMD窗口上使用yii migrate/up
。如何使字段枚舉遷移yii2
public function up()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
}
$this->createTable('{{%user_social_media}}', [
'social_media' => $this->ENUM('facebook', 'google', 'twitter', 'github'),
'id' => $this->primaryKey(),
'username' => $this->string(),
'user_id' => $this->integer(11),
'created_at' => $this->integer(11),
'updated_at' => $this->integer(11),
], $tableOptions);
}
好的解決感謝.. – CrashBurn
然後將其標記爲sloved,請:) –
以防萬一它的公開討論它在未來的變化:https://github.com/ yiisoft/yii2 /問題/ 9797 –