Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 4
Migrate
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 4
 run
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 4
<?php namespace App\Commands;
use Framework\CLI\CLI;
use Framework\CLI\Command;
use Framework\Database\Extra\Migrator;
class Migrate extends Command
{
    protected string $name = 'migrate';
    protected string $description = 'Run migrations.';
    protected string $usage = 'migrate [options] -- [arguments]';
    protected array $options = [
        '-d, --down' => 'Run migrations down.',
        '-u, --up' => 'Run migrations up.',
        '--to' => 'Run migrations to specifc version.',
    ];
    public function run(array $options = [], array $arguments = []) : void
    {
        $migrator = new Migrator(\App::database(), \App::locator());
        CLI::write($migrator->getCurrentVersion());
    }
}