PHP code example of mindy / migration-manager
1. Go to this page and download the library: Download mindy/migration-manager 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/ */
mindy / migration-manager example snippets
use Doctrine\DBAL\DriverManager;
use Mindy\Component\MigrationManager\MigrationFactory;
$connection = DriverManager::getConnection(['url' => 'sqlite:///:memory:']);
$manager = MigrationFactory::createManager($connection, 'application', __DIR__.'/Migrations', '\\Application\Migrations');
// Generate new migration
$migrationPath = $manager->generateMigration();
echo $migrationPath . PHP_EOL;
// Migrate
$manager->doMigrate();