PHP code example of gersonalves / migration

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

    

gersonalves / migration example snippets


use migration\migration;
$myConnection = new PDO("mysql:host=localhost:3307;dbname=docker", 'docker', 'docker', [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);

$migration = migration::run($myConnection, [
    'table' => 'migracoes',
    'migrations_dir' => 'migrations',
    'onlyJSON' => true,
    'continueWithErrors' => true,
    'mailTo' => '[email protected]'
]);
$migration->getResponse();