I want to add a new column through migration in Yii2, using this code:
public function up()
{
$this->addColumn('news', 'priority', $this->integer());
}
public function down()
{
$this->dropColumn('news', 'priority');
}
And it works but I want it to be second column, after name.
It is possible?
OK, can you try this:
$this->addColumn('news', 'priority', 'integer AFTER `name`');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With