Skip to content

Instantly share code, notes, and snippets.

@moritz-h
Last active September 23, 2016 11:00
Show Gist options
  • Save moritz-h/579f43c8af02f3644115d91185b73f6e to your computer and use it in GitHub Desktop.
Save moritz-h/579f43c8af02f3644115d91185b73f6e to your computer and use it in GitHub Desktop.
phinx bug
<?php
use Phinx\Migration\AbstractMigration;
class InitDb extends AbstractMigration
{
public function up()
{
// do nothing
}
public function down()
{
// do nothing
}
}
{
"require": {
"robmorgan/phinx": "v0.6.4"
}
}
<?php
require __DIR__.'/vendor/autoload.php';
$app = new \Phinx\Console\PhinxApplication();
$wrap = new \Phinx\Wrapper\TextWrapper($app);
$wrap->setOption('environment', 'db');
$wrap->setOption('configuration', 'phinx.php');
$wrap->setOption('parser', 'php');
echo $wrap->getRollback(null, 0);
echo $wrap->getMigrate();
echo $wrap->getRollback(null, 0);
<?php
return [
'paths' => [
'migrations' => '%%PHINX_CONFIG_DIR%%/migrations',
],
'environments' => [
'default_migration_table' => 'phinxlog',
'default_database' => 'db',
'db' => [
'adapter' => 'mysql',
'host' => '127.0.0.1',
'name' => 'test',
'user' => 'test',
'pass' => 'test',
'port' => '3306',
'charset' => 'utf8mb4',
'table_prefix' => '',
],
],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment