aboutsummaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/Commands/DB/MoveMatrikelnummer.php (renamed from cli/Commands/Migrate/MigrateMatrikelnummer.php)23
-rwxr-xr-xcli/studip2
2 files changed, 13 insertions, 12 deletions
diff --git a/cli/Commands/Migrate/MigrateMatrikelnummer.php b/cli/Commands/DB/MoveMatrikelnummer.php
index fbad2d8..251aba5 100644
--- a/cli/Commands/Migrate/MigrateMatrikelnummer.php
+++ b/cli/Commands/DB/MoveMatrikelnummer.php
@@ -1,24 +1,28 @@
<?php
-namespace Studip\Cli\Commands\Migrate;
+namespace Studip\Cli\Commands\DB;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
-class MigrateMatrikelnummer extends Command
+class MoveMatrikelnummer extends Command
{
- protected static $defaultName = 'migrate:matrikelnummer';
+ protected static $defaultName = 'db:move_matrikelnummer';
- protected function configure() : void
+ protected function configure(): void
{
- $this->setDescription('Migrates the "Matrikelnummer" datafield into the matriculation_number column of the auth_user_md5 table.');
- $this->setHelp('This command migrates the "Matrikelnummer" datafield into the matriculation_number column of the auth_user_md5 table. The ID of the datafield must be provided. The datafield is not deleted in the migration process.');
+ $this->setDescription(
+ 'Migrates the "Matrikelnummer" datafield into the matriculation_number column of the auth_user_md5 table.'
+ );
+ $this->setHelp(
+ 'This command migrates the "Matrikelnummer" datafield into the matriculation_number column of the auth_user_md5 table. The ID of the datafield must be provided. The datafield is not deleted in the migration process.'
+ );
$this->addOption('id', 'i', InputOption::VALUE_REQUIRED, 'The ID of the "Matrikelnummer" datafield.', null);
}
- protected function execute(InputInterface $input, OutputInterface $output) : int
+ protected function execute(InputInterface $input, OutputInterface $output): int
{
$datafield_id = $input->getOption('id');
if (!$datafield_id) {
@@ -56,10 +60,7 @@ class MigrateMatrikelnummer extends Command
}
};
- \DatafieldEntryModel::findEachByDatafield_id(
- $modifier,
- $datafield->id
- );
+ \DatafieldEntryModel::findEachByDatafield_id($modifier, $datafield->id);
return Command::SUCCESS;
}
diff --git a/cli/studip b/cli/studip
index c4addb9..9da3b94 100755
--- a/cli/studip
+++ b/cli/studip
@@ -31,6 +31,7 @@ $commands = [
Commands\Cronjobs\CronjobWorker::class,
Commands\Cronjobs\CronjobWorker::class,
Commands\DB\Dump::class,
+ Commands\DB\MoveMatrikelnummer::class,
Commands\Files\Dump::class,
Commands\Fix\Biest7789::class,
Commands\Fix\Biest7866::class,
@@ -38,7 +39,6 @@ $commands = [
Commands\Fix\EndTimeWeeklyRecurredEvents::class,
Commands\Fix\IconDimensions::class,
Commands\HelpContent\Migrate::class,
- Commands\Migrate\MigrateMatrikelnummer::class,
Commands\Migrate\MigrateList::class,
Commands\Migrate\MigrateStatus::class,
Commands\Migrate\Migrate::class,