<commit_before><?php

use Phoenix\Config\Config;
use Phoenix\Database\Adapter\AdapterFactory;
use Phoenix\Migration\Init\Init;
use Phoenix\Migration\Manager;

require_once __DIR__ . '/../vendor/autoload.php';

$configuration = [
    'migration_dirs' => [
        __DIR__ . '/phoenix',
    ],
    'environments' => [
        'mysql' => [
            'adapter' => 'mysql',
            'db_name' => 'libs',
            'host' => 'localhost',
            'username' => 'root',
            'password' => '<PASSWORD>',
            'charset' => 'utf8',
        ],
        'sqlite_file' => [
            'adapter' => 'sqlite',
            'dsn' => 'sqlite:' . __DIR__ . '/phoenix.sqlite',
        ],
        'sqlite' => [
            'adapter' => 'sqlite',
            'dsn' => 'sqlite::memory:',
        ],
        'pgsql' => [
            'adapter' => 'pgsql',
            'db_name' => 'libs',
            'host' => 'localhost',
            'username' => 'postgres',
            'password' => '<PASSWORD>',
            'charset' => 'utf8',
        ],
    ],
];

foreach (array_keys($configuration['environments']) as $environment) {
    echo "Adapter: $environment\n";
    $config = new Config($configuration);
    $adapter = AdapterFactory::instance($config->getEnvironmentConfig($environment));
    
    $initMigration = new Init($adapter, $config->getLogTableName());
    $initMigration->migrate();
    
    $manager = new Manager($config, $adapter);
    $migrations = $manager->findMigrationsToExecute();
    foreach ($migrations as $migration) {
        $migration->migrate();
        $manager->logExecution($migration);
        $migration->rollback();
        $manager->removeExecution($migration);
        $migration->migrate();
        $manager->logExecution($migration);
//        print_R($migration->getExecutedQueries());
    }
    echo "All OK\n\n";
}<commit_msg>uncomment debug message in run.php<commit_after><?php

use Phoenix\Config\Config;
use Phoenix\Database\Adapter\AdapterFactory;
use Phoenix\Migration\Init\Init;
use Phoenix\Migration\Manager;

require_once __DIR__ . '/../vendor/autoload.php';

$configuration = [
    'migration_dirs' => [
        __DIR__ . '/phoenix',
    ],
    'environments' => [
        'mysql' => [
            'adapter' => 'mysql',
            'db_name' => 'libs',
            'host' => 'localhost',
            'username' => 'root',
            'password' => '<PASSWORD>',
            'charset' => 'utf8',
        ],
        'sqlite_file' => [
            'adapter' => 'sqlite',
            'dsn' => 'sqlite:' . __DIR__ . '/phoenix.sqlite',
        ],
        'sqlite' => [
            'adapter' => 'sqlite',
            'dsn' => 'sqlite::memory:',
        ],
        'pgsql' => [
            'adapter' => 'pgsql',
            'db_name' => 'libs',
            'host' => 'localhost',
            'username' => 'postgres',
            'password' => '<PASSWORD>',
            'charset' => 'utf8',
        ],
    ],
];

foreach (array_keys($configuration['environments']) as $environment) {
    echo "Adapter: $environment\n";
    $config = new Config($configuration);
    $adapter = AdapterFactory::instance($config->getEnvironmentConfig($environment));
    
    $initMigration = new Init($adapter, $config->getLogTableName());
    $initMigration->migrate();
    
    $manager = new Manager($config, $adapter);
    $migrations = $manager->findMigrationsToExecute();
    foreach ($migrations as $migration) {
        $migration->migrate();
        $manager->logExecution($migration);
        $migration->rollback();
        $manager->removeExecution($migration);
        $migration->migrate();
        $manager->logExecution($migration);
        print_R($migration->getExecutedQueries());
    }
    echo "All OK\n\n";
}
{'fraction_non_alphanumeric': 0.17966462603140804, 'fraction_numerical': 0.001064679265371307, 'mean_word_length': 2.284965034965035, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 73, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '894380', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1137, 'n_words': 188}