M
M
McMike2016-12-19 11:27:11
Yii
McMike, 2016-12-19 11:27:11

Is it possible to add a comment to a column in the db during migration?

Is it possible to add a comment to a column in the db during migration? A comment from a year ago says that there is no such possibility. Has anything changed since then?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2016-12-19
@qonand

There is such an opportunity, for example, when creating a table, you can set a comment like this:

$this->createTable('mytable', [
    'id' => $this->primaryKey()
          ->comment('Уникальный идентификатор записи'),
]);

If the table exists, you can do this:
$this->addCommentOnColumn('mytable', 'id', 'Уникальный идентификатор записи');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question