How can I add comment for specific SQL-table in Yii2 migration?
SQL code:
ALTER TABLE
my_tableCOMMENT 'Hello World'
I wand to do in within a migration in ORM way
In yii2 format
Example: In migration file
$this->addCommentOnColumn('user','role_id','Relation table of role');
Currently there is no such functionality in Yii 2 migrations.
You have to write it in plain SQL via execute() method:
$this->execute("ALTER TABLE my_table COMMENT 'Hello World'");
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