PHP code example of majpage / simple-database-migrations

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

    

majpage / simple-database-migrations example snippets


use SimpleDatabaseMigrations\Command\MigrationsCommand;
use SimpleDatabaseMigrations\Manager\MigrationsManager;

$container = $this->getContainer();
$container
    ->setObject('migrationsManager', MigrationsManager::class, ['db'], [
        $container->get('baseDir') . '/src/Migration', 'MyProject\\Migration',
    ])
    ->setObject('migrationsCommand', MigrationsCommand::class, ['migrationsManager'])
;

#!/usr/bin/env php


use MyProject\Bootstrap;
use SimpleDatabaseMigrations\Command\MigrationsCommand;

$baseDir = realpath(dirname(__FILE__) . '/..');
$command->execute($argv);