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

Run migration through code #151

Open
wellingguzman opened this issue Feb 13, 2015 · 1 comment
Open

Run migration through code #151

wellingguzman opened this issue Feb 13, 2015 · 1 comment

Comments

@wellingguzman
Copy link
Contributor

Is there a way to run ruckusing-migrations via php?

Ex.

$main = new Ruckusing_FrameworkRunner($db_config, array('','db:migrate'));
if($main->execute()) {
    echo "everything was ok";
} else {
    echo "something wrong happened";
}

Am I doing something wrong or is like not possible to do it without change the code, because of the use of __DIR__ and getcwd() which will return a not desired path.

@garex
Copy link
Contributor

garex commented Nov 22, 2015

Yes it's possible. See example https://github.com/garex/wp-testing/blob/44496b4419071a94b4e1f222b676a31d7e9847d9/src/Facade.php#L405

Also in this repo's tests there is example of running migrations.

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

No branches or pull requests

2 participants