Answers for "yii2 migration add column"

PHP
1

yii2 migration add column

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');
    }
}
Posted by: Guest on August-02-2020

Browse Popular Code Answers by Language