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;
MigrationRunner::clear();
$connection = MigrationRunner::getConnection();
$forge = MigrationRunner::getForge();
$history = MigrationRunner::getHistory();
$migration = MigrationRunner::getMigration($version);
$migrations = MigrationRunner::getMigrations();
$namespace = MigrationRunner::getNamespace();
$hasMigration = MigrationRunner::hasMigration($version);
MigrationRunner::migrate($version);
MigrationRunner::rollback($version);
MigrationRunner::setConnection($connection);
MigrationRunner::setNamespace($namespace);
$migration->down();
$migration->up();
use Fyre\Forge\MigrationHistoryRegistry;
$history = MigrationHistoryRegistry::getHistory($connection);
MigrationHistoryRegistry::setHandler($connectionClass, $historyClass);
$history->add($migration);
$all = $history->all();
$version = $history->current();