應(yīng)為數(shù)據(jù)庫(kù)表的結(jié)構(gòu)被緩存了。刪除runtime文件夾或者執(zhí)行
//清理指定表結(jié)構(gòu)緩存數(shù)據(jù) Yii::$app->db->getSchema()->refreshTableSchema('{{%post}}');//這里post是出去表前綴的表名 //清理所有表結(jié)構(gòu)緩存數(shù)據(jù) Yii::$app->db->getSchema()->refresh();
完成!
學(xué)習(xí)教程推薦:yii框架