-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build: update dependencies * build: upgrade deps * wip: extract migration into cli command * wip: rename bin script * wip: refactor execture command * feature: integrate migrator class * refactor: remove obsolete functionality * feature: improve exceptions
- Loading branch information
Showing
10 changed files
with
372 additions
and
185 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
/** | ||
* Database migration iterates over a set of incremental schema changes and | ||
* stores the currently-migrated schema version within the database itself. | ||
*/ | ||
|
||
use Gt\Cli\Application; | ||
use Gt\Cli\Argument\CommandArgumentList; | ||
use Gt\Database\Cli\ExecuteCommand; | ||
|
||
// The script must be run from the context of a project's root directory. | ||
foreach([ __DIR__ . "/../../..", __DIR__ . "/../vendor" ] as $vendor) { | ||
$autoload = "$vendor/autoload.php"; | ||
if(file_exists($autoload)) { | ||
require($autoload); | ||
break; | ||
} | ||
} | ||
|
||
$app = new Application( | ||
"Migrate the database", | ||
new CommandArgumentList("execute", ...$argv), | ||
new ExecuteCommand(), | ||
); | ||
$app->run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.