migrations/Version20240830144100.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20240830144100 extends AbstractMigration
  7. {
  8.     public function getDescription(): string
  9.     {
  10.         return 'Update message document generator info table name';
  11.     }
  12.     public function up(Schema $schema): void
  13.     {
  14.         $this->skipIf(
  15.             true === $schema->hasTable('document_generator_callback_info'),
  16.             'The document_generator_callback_info is already set as table name!'
  17.         );
  18.         // Using raw sql because of specific schema issue
  19.         $this->addSql('RENAME TABLE message_document_generator_info TO document_generator_callback_info');
  20.     }
  21.     public function down(Schema $schema): void
  22.     {
  23.         $this->skipIf(
  24.             true === $schema->hasTable('message_document_generator_info'),
  25.             'The message_document_generator_info is already set as table name!'
  26.         );
  27.         // Using raw sql because of specific schema issue
  28.         $this->addSql('RENAME TABLE document_generator_callback_info TO message_document_generator_info');
  29.     }
  30. }