Commit 74760c2d authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Merge branch 'detached4' into 'main'

Ajout d'une nouvelle commande bddadmin:update-sequences qui met à jour les...

See merge request !3
parents 3f75e5e3 b65d6d06
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
1.3.0 (26/02/2025)
------------------

- Ajout d'une nouvelle commande bddadmin:update-sequences qui met à jour les séquences en fonction des ID les plus élevés


1.2.0 (20/02/2025)
------------------

+21 −19
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ return [
            Command\UpdateCommand::class          => Command\CommandFactory::class,
            Command\UpdateDdlCommand::class       => Command\CommandFactory::class,
            Command\UpdateDataCommand::class      => Command\CommandFactory::class,
            Command\UpdateSequencesCommand::class => Command\CommandFactory::class,
            Command\ClearCommand::class           => Command\CommandFactory::class,
            Command\CopyToCommand::class          => Command\CommandFactory::class,
            Command\CopyFromCommand::class        => Command\CommandFactory::class,
@@ -75,6 +76,7 @@ return [
            'bddadmin:clear'            => Command\ClearCommand::class,
            'bddadmin:update-ddl'       => Command\UpdateDdlCommand::class,
            'bddadmin:update-data'      => Command\UpdateDataCommand::class,
            'bddadmin:update-sequences' => Command\UpdateSequencesCommand::class,
            'bddadmin:copy-to'          => Command\CopyToCommand::class,
            'bddadmin:copy-from'        => Command\CopyFromCommand::class,
            'bddadmin:load'             => Command\LoadCommand::class,
+41 −0
Original line number Diff line number Diff line
<?php

namespace Unicaen\BddAdmin\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Console\Style\SymfonyStyle;
use Unicaen\BddAdmin\BddAwareTrait;
use Unicaen\BddAdmin\Data\DataManager;
use Unicaen\BddAdmin\Ddl\Ddl;
use Unicaen\BddAdmin\Util;

/**
 * Description of LoadCommand
 *
 * @author Laurent Lécluse <laurent.lecluse at unicaen.fr>
 */
class UpdateSequencesCommand extends Command
{
    use BddAwareTrait;

    protected function configure(): void
    {
        $this->setDescription('Mise à jour des séquences de la base de données');
    }



    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $io  = new SymfonyStyle($input, $output);
        $bdd = $this->getBdd()->setLogger($io);

        $bdd->majSequences();

        return Command::SUCCESS;
    }
}
 No newline at end of file