PHP code example of fyre / migration

1. Go to this page and download the library: Download fyre/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/ */

    

fyre / migration example snippets


use Fyre\Migration\MigrationRunner;

$runner = new MigrationRunner($container, $loader, $connectionManager, $forgeRegistry);

$container->singleton(MigrationRunner::class);

$runner = $container->use(MigrationRunner::class);

$runner->addNamespace($namespace);

$runner->clear();

$connection = $runner->getConnection();

$forge = $runner->getForge();

$history = $runner->getHistory();

$migrations = $runner->getMigrations();

$namespaces = $runner->getNamespaces();

$hasNamespace = $php->hasNamespace($namespace);

$runner->migrate($latestVersion);

$runner->rollback($batches, $steps);

$runner->setConnection($connection);

$runner->removeNamespace($namespace);

$migration->down();

$migration->up();

$history->add($name, $batch);

$all = $history->all();

$history->delete($name);

$batch = $history->getNextBatchNumber();

$commandRunner->run('db:migrate', ['--db', 'default']);

$commandRunner->run('db:rollback', ['--db', 'default', '--batches', '1', '--steps', 1]);