Skip to content

Commit d930f1d

Browse files
committed
adds migration commands infos
1 parent 0007ec9 commit d930f1d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/Ubiquity/devtools/cmd/Command.php

+27
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,31 @@ public static function newEncryptionKey() {
737737
], 'security');
738738
}
739739

740+
public static function infoMigrations() {
741+
return new Command("info-migrations", "", "Returns the migration infos.", [
742+
'info_migrations',
743+
'info:migrations',
744+
'infoMigrations'
745+
], [
746+
"d" => Parameter::create("database", "The database offset.", [], 'default'),
747+
'o' => Parameter::create('domain', 'The domain in which the database models are.', [], '')
748+
], [
749+
'Display all migrations for the default database' => 'Ubiquity info:migrations'
750+
], 'models');
751+
}
752+
753+
public static function migrations() {
754+
return new Command("migrations", "", "Display and execute the database migrations.", [
755+
'migrations',
756+
'migrate'
757+
], [
758+
"d" => Parameter::create("database", "The database offset.", [], 'default'),
759+
'o' => Parameter::create('domain', 'The domain in which the database models are.', [], '')
760+
], [
761+
'Display and execute all migrations for the default database' => 'Ubiquity migrations'
762+
], 'models');
763+
}
764+
740765
protected static function getCustomCommandInfos() {
741766
$result = [];
742767
$commands = self::getCustomCommands();
@@ -828,6 +853,8 @@ public static function getCommands() {
828853
self::version(),
829854
self::model(),
830855
self::allModels(),
856+
self::infoMigrations(),
857+
self::migrations(),
831858
self::dao(),
832859
self::selfUpdate(),
833860
self::composer(),

0 commit comments

Comments
 (0)