yii2
yii2 copied to clipboard
Missing direct access to addCheck() in migration
With merge https://github.com/yiisoft/yii2/commit/e0dde88b87aa135273376aa7344cb3e597f77f67 the addCheck() has been added in order to support check on table create/alter
But it is not directly accessible from the migration instance like
$this->addCheck()
It is missing the mapping inside yii2/db/Migration.php
It is possible to access it via
$this->db->createCommand()->addCheck();
But as it is not documented, it is difficult to find without code digging.
Additional info
Q | A |
---|---|
Yii version | 2.0.47 |
PHP version | 7.4 |
Operating system | debian |
Good catch. Do you have time for a pull request?
I think I can start to work on in a couple of weeks.
Starting to work on it, a bit of delay due to university exams session. Looking at Migration.php and where to insert the new code, any preferences? The logic position should be between alterColumn() and addPrimaryKey() or between dropForeignKey() and createIndex()
Looking at Migration.php and where to insert the new code, any preferences?
No. Feel free to choose it.