diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2018-08-20 20:58:51 +0200 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2018-08-20 21:07:57 +0200 |
commit | d6c8f1a61475fefa9594141aaf12a28d220bdaf8 (patch) | |
tree | 905051fdb1307f947c3a3a7be240609f8bc00e59 /bin/migrate | |
parent | bf6efe532c8f2de84e95b090911280a9b1b61ce8 (diff) | |
parent | 2f41b9e4418def9b69cf237312bc592364585025 (diff) |
Merge branch 'master' to 'rebuild-database'
Diffstat (limited to 'bin/migrate')
-rwxr-xr-x | bin/migrate | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bin/migrate b/bin/migrate new file mode 100755 index 00000000..20ae2a93 --- /dev/null +++ b/bin/migrate @@ -0,0 +1,21 @@ +#!/usr/bin/env php +<?php + +use Composer\Autoload\ClassLoader; +use Engelsystem\Application; +use Engelsystem\Database\Migration\Migrate; +use Engelsystem\Database\Migration\MigrationServiceProvider; + +require_once __DIR__ . '/../includes/application.php'; + +/** @var $loader ClassLoader */ +$baseDir = __DIR__ . '/../db/migrations'; + +/** @var Application $app */ +$app = app(); +$app->register(MigrationServiceProvider::class); + +/** @var Migrate $migration */ +$migration = $app->get('db.migration'); +$migration->setOutput(function ($text) { echo $text . PHP_EOL; }); +$migration->run($baseDir, Migrate::UP); |