21 lines
653 B
PHP
21 lines
653 B
PHP
|
|
#!/usr/bin/env php
|
||
|
|
<?php
|
||
|
|
|
||
|
|
require __DIR__ . '/../vendor/autoload.php';
|
||
|
|
require __DIR__ . '/../bootstrap/database.php';
|
||
|
|
|
||
|
|
use Illuminate\Filesystem\Filesystem;
|
||
|
|
use Illuminate\Database\Migrations\DatabaseMigrationRepository;
|
||
|
|
use Illuminate\Database\Migrations\Migrator;
|
||
|
|
|
||
|
|
$repository = new DatabaseMigrationRepository($capsule->getDatabaseManager(), 'migrations');
|
||
|
|
$migrator = new Migrator($repository, $capsule->getDatabaseManager(), new Filesystem);
|
||
|
|
|
||
|
|
if (! $repository->repositoryExists()) {
|
||
|
|
$repository->createRepository();
|
||
|
|
echo "Migration table created.\n";
|
||
|
|
}
|
||
|
|
|
||
|
|
$migrator->run(__DIR__ . '/../database/migrations');
|
||
|
|
echo "Migrations complete.\n";
|