Skip to content

Commit 2c7ca43

Browse files
committed
✨ add --dump-database key to run:migration command
Signed-off-by: otengkwame <[email protected]>
1 parent 08cbfd3 commit 2c7ca43

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Core/core/Console/Console.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,22 @@ protected static function runMigration(...$args)
912912
exit;
913913
}
914914

915+
if ($key === '--dump-database' || $key === '--dd') {
916+
917+
$name = date('Y-m-d-His');
918+
919+
$command = Console::phpCommand() . 'migration/dumpDb/'.$name;
920+
921+
if (isset($args[1]) && !empty($args[1])) {
922+
$step = explode('=', $args[1]);
923+
$name = $step[1];
924+
$command = Console::phpCommand() . 'migration/dumpDb/'.$name;
925+
}
926+
927+
static::runSystemCommand($command);
928+
exit;
929+
}
930+
915931
if ($key != null ) {
916932
$steps = explode('=', $key);
917933
}

0 commit comments

Comments
 (0)