Created
February 16, 2015 15:37
-
-
Save gwagroves/03546aa1ccd8b23d6f49 to your computer and use it in GitHub Desktop.
Phinx: Run migration from inside PHP script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Phinx\Config\Config; | |
use Phinx\Migration\Manager; | |
use Symfony\Component\Console\Output\NullOutput; | |
$migrationspath = 'path/to/migrations/folder'; | |
$config = new Config(array( | |
'paths' => array( | |
'migrations' => $migrationspath | |
), | |
'environments' => array( | |
'testing' => array( | |
'adapter' => 'sqlite', | |
'memory' => true | |
) | |
) | |
)); | |
$output = new NullOutput(); | |
$manager = new Manager($config, $output); | |
$manager->migrate('testing'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment