M
M
Mikhail Artemiev2017-04-04 10:54:56
Yii
Mikhail Artemiev, 2017-04-04 10:54:56

How to set a comment for a table from the console in migrate/create_table?

Is there any native way or extension to generate migrations from the command line immediately with a comment for the table being created?
Or a command to create a migration separately adding a comment.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Artemiev, 2017-04-05
@the_mix

I did not find a suitable solution, I requested the missing functionality in the core of the framework,
https://github.com/yiisoft/yii2/pull/13919
will appear in version 2.0.14.

D
Dmitrij, 2017-04-05
@Vahmur

I can't check right now, but probably just something like...

$this->addColumn('{{%job}}', 'enabled', $this->boolean()->notNull()->defaultValue(1)->after('table_field')) . ' COMMENT "bla-bla"';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question