Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing direct access to addCheck() in migration #19817

Closed
bobonov opened this issue Apr 27, 2023 · 4 comments
Closed

Missing direct access to addCheck() in migration #19817

bobonov opened this issue Apr 27, 2023 · 4 comments
Labels

Comments

@bobonov
Copy link
Contributor

bobonov commented Apr 27, 2023

With merge e0dde88 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
@samdark samdark added the type:bug Bug label May 4, 2023
@samdark samdark added this to the 2.0.48 milestone May 4, 2023
@samdark
Copy link
Member

samdark commented May 4, 2023

Good catch. Do you have time for a pull request?

@bobonov
Copy link
Contributor Author

bobonov commented May 5, 2023

I think I can start to work on in a couple of weeks.

@samdark samdark removed this from the 2.0.48 milestone May 7, 2023
@bobonov
Copy link
Contributor Author

bobonov commented Jul 4, 2023

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()

@samdark
Copy link
Member

samdark commented Jul 5, 2023

Looking at Migration.php and where to insert the new code, any preferences?

No. Feel free to choose it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants