1. Go to this page and download the library: Download kuaukutsu/poc-migration library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kuaukutsu / poc-migration example snippets
$migrator = new Migrator(
collection: new MigrationCollection(
new Migration(
path: __DIR__ . '/migration/postgres/main',
driver: new PdoDriver(
dsn: 'pgsql:host=postgres;port=5432;dbname=main',
username: 'postgres',
password: 'postgres',
)
)
),
);
use DI\Container;
use kuaukutsu\poc\migration\internal\connection\PDO\Driver;
use kuaukutsu\poc\migration\example\presentation\DownCommand;
use kuaukutsu\poc\migration\example\presentation\CreateCommand;
use kuaukutsu\poc\migration\example\presentation\FixtureCommand;
use kuaukutsu\poc\migration\example\presentation\VerifyCommand;
use kuaukutsu\poc\migration\example\presentation\InitCommand;
use kuaukutsu\poc\migration\example\presentation\RedoCommand;
use kuaukutsu\poc\migration\example\presentation\UpCommand;
use kuaukutsu\poc\migration\tools\PrettyConsoleOutput;
use kuaukutsu\poc\migration\Migration;
use kuaukutsu\poc\migration\MigrationCollection;
use kuaukutsu\poc\migration\Migrator;
use kuaukutsu\poc\migration\MigratorInterface;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
d::class,
'migrate:verify' => VerifyCommand::class,
'migrate:fixture' => FixtureCommand::class,
'migrate:create' => CreateCommand::class,
],
)
);
try {
exit($console->run());
} catch (Exception $e) {
exit(Command::FAILURE);
}