Skip to content

Commit 2ab2154

Browse files
author
Greg Bowler
committed
Migrate command, closes #4
1 parent 4e4093e commit 2ab2154

3 files changed

Lines changed: 67 additions & 18 deletions

File tree

bin/gt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ $app = new \Gt\Cli\Application(
2424
new RunCommand(),
2525
new BuildCommand(),
2626
new CronCommand(),
27-
new ServeCommand()
27+
new ServeCommand(),
28+
new MigrateCommand()
2829
);
2930
$app->run();

composer.lock

Lines changed: 16 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Command/MigrateCommand.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
namespace Gt\Installer\Command;
3+
4+
use Gt\Cli\Argument\ArgumentValueList;
5+
use Gt\Cli\Parameter\NamedParameter;
6+
use Gt\Cli\Parameter\Parameter;
7+
8+
class MigrateCommand extends AbstractWebEngineCommand {
9+
public function run(ArgumentValueList $arguments = null):void {
10+
$this->executeScript(
11+
$arguments,
12+
"db-migrate"
13+
);
14+
}
15+
16+
public function getName():string {
17+
return "migrate";
18+
}
19+
20+
public function getDescription():string {
21+
return "Run the database migrations";
22+
}
23+
24+
/** @return NamedParameter[] */
25+
public function getRequiredNamedParameterList():array {
26+
return [];
27+
}
28+
29+
/** @return NamedParameter[] */
30+
public function getOptionalNamedParameterList():array {
31+
return [];
32+
}
33+
34+
/** @return Parameter[] */
35+
public function getRequiredParameterList():array {
36+
return [];
37+
}
38+
39+
/** @return Parameter[] */
40+
public function getOptionalParameterList():array {
41+
return [
42+
new Parameter(
43+
false,
44+
"force",
45+
"f"
46+
),
47+
];
48+
}
49+
}

0 commit comments

Comments
 (0)