📜  yii2 迁移添加列 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:08.840000             🧑  作者: Mango

代码示例1
class m150811_220037_add_position_column_to_post_table extends Migration
{
    public function up()
    {
        $this->addColumn('post', 'position', $this->integer());
    }

    public function down()
    {
        $this->dropColumn('post', 'position');
    }
}