Skip to content

Commit

Permalink
Added automigrate command
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianFun123 committed Jul 26, 2022
1 parent 878bb1e commit 9a61518
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"require": {
"php": ">=8.0.0",
"interaapps/uloleorm": "3.1.2",
"interaapps/uloleorm": "3.1.3",
"interaapps/jsonplus": "1.0.5",
"interaapps/deverm": "5.1.0",
"ext-pdo": "*"
Expand Down
5 changes: 5 additions & 0 deletions src/main/de/interaapps/ulole/core/cli/modules/ORMCLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use de\interaapps\ulole\core\cli\Colors;
use de\interaapps\ulole\orm\migration\Migrator;
use de\interaapps\ulole\orm\migration\table\MigrationModel;
use de\interaapps\ulole\orm\UloleORM;

class ORMCLI extends CLIHandler {
public function registerCommands(CLI $cli) {
Expand All @@ -19,6 +20,10 @@ public function registerCommands(CLI $cli) {
->up();
}, "Migrates a database");

$cli->register("migrate:auto", function () {
UloleORM::autoMigrate();
}, "Calls UloleORM::autoMigrate()");

$cli->register("migrate:down", function ($args) {
if (!isset($args[2]))
$args[2] = 1;
Expand Down
Binary file removed test.db
Binary file not shown.
2 changes: 1 addition & 1 deletion uppm.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"serve": {},
"modules": {
"interaapps\/jsonplus": "1.0.5",
"uloleorm": "3.1.2",
"uloleorm": "3.1.3",
"deverm": "5.1.0"
},
"namespaceBindings": {
Expand Down

0 comments on commit 9a61518

Please sign in to comment.