Skip to content

Commit

Permalink
generate:upgrader - Enable AutomaticUpgrader by default
Browse files Browse the repository at this point in the history
  • Loading branch information
totten committed Apr 19, 2024
1 parent 147cb04 commit 5223b20
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/CRM/CivixBundle/Command/AddUpgraderCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use CRM\CivixBundle\Application;
use Civix;
use CRM\CivixBundle\Utils\Files;
use CRM\CivixBundle\Utils\Naming;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use CRM\CivixBundle\Builder\Dirs;
Expand Down Expand Up @@ -55,9 +56,8 @@ protected function execute(InputInterface $input, OutputInterface $output) {
$output->writeln(sprintf('<error>Skip %s: file already exists, defer to customized version</error>', Files::relativize($phpFile)));
}

if (!$info->get()->xpath('upgrader')) {
$info->get()->addChild('upgrader', $crmPrefix . '_Upgrader');
}
// AutomaticUpgrader delegates to CRM_*_Upgrader and also supports automatic SQL generation.
$info->get()->upgrader = sprintf('CiviMix\\Schema\\%s\\AutomaticUpgrader', Naming::createCamelName($info->getFile()));
$info->raiseCompatibilityMinimum('5.38');
$info->save($ctx, $output);

Expand Down

0 comments on commit 5223b20

Please sign in to comment.