vendor/pimcore/data-importer/src/Migrations/Version20211201173215.php line 1

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under two different licenses:
  6.  * - GNU General Public License version 3 (GPLv3)
  7.  * - Pimcore Commercial License (PCL)
  8.  * Full copyright and license information is available in
  9.  * LICENSE.md which is distributed with this source code.
  10.  *
  11.  * @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  12.  * @license    http://www.pimcore.org/license     GPLv3 and PCL
  13.  */
  14. declare(strict_types=1);
  15. /**
  16.  * Pimcore
  17.  *
  18.  * This source file is available under two different licenses:
  19.  * - GNU General Public License version 3 (GPLv3)
  20.  * - Pimcore Commercial License (PCL)
  21.  * Full copyright and license information is available in
  22.  * LICENSE.md which is distributed with this source code.
  23.  *
  24.  *  @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  25.  *  @license    http://www.pimcore.org/license     GPLv3 and PCL
  26.  */
  27. namespace Pimcore\Bundle\DataImporterBundle\Migrations;
  28. use Doctrine\DBAL\Schema\Schema;
  29. use Pimcore\Migrations\BundleAwareMigration;
  30. final class Version20211201173215 extends BundleAwareMigration
  31. {
  32.     protected const ORIGINAL_NAME 'bundle_data_hub_data_importer_last_cron_execution';
  33.     protected const TARGET_NAME 'bundle_data_hub_data_importer_last_execution';
  34.     protected function getBundleName(): string
  35.     {
  36.         return 'PimcoreDataImporterBundle';
  37.     }
  38.     public function getDescription(): string
  39.     {
  40.         return 'Rename last execution table';
  41.     }
  42.     public function up(Schema $schema): void
  43.     {
  44.         if ($schema->hasTable(self::ORIGINAL_NAME)) {
  45.             $this->addSql(sprintf('RENAME TABLE `%s` TO `%s`'self::ORIGINAL_NAMEself::TARGET_NAME));
  46.         }
  47.     }
  48.     public function down(Schema $schema): void
  49.     {
  50.         if ($schema->hasTable(self::TARGET_NAME)) {
  51.             $this->addSql(sprintf('RENAME TABLE `%s` TO `%s`'self::TARGET_NAMEself::ORIGINAL_NAME));
  52.         }
  53.     }
  54. }