Skip to content

Commit

Permalink
Merge pull request #1729 from tarlepp/refactor/migration-template
Browse files Browse the repository at this point in the history
Refactor - Migration template
  • Loading branch information
tarlepp committed Mar 11, 2022
2 parents 71f35df + 29a2d47 commit 2126b10
Showing 1 changed file with 2 additions and 29 deletions.
31 changes: 2 additions & 29 deletions templates/Doctrine/migration.tpl
@@ -1,10 +1,8 @@
<?php
declare(strict_types = 1);

// phpcs:ignoreFile
namespace <namespace>;

use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

Expand All @@ -21,41 +19,16 @@ final class <className> extends AbstractMigration
return 'TODO: Describe reason for this migration';
}

/**
* @noinspection PhpMissingParentCallCommonInspection
*/
public function isTransactional(): bool
{
return false;
}

/**
* @throws Exception
*/
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
$this->connection->getDatabasePlatform()->getName() !== 'mysql',
'Migration can only be executed safely on \'mysql\'.'
);
<up>
}

/**
* @noinspection PhpMissingParentCallCommonInspection
*
* @throws Exception
*/
* @noinspection PhpMissingParentCallCommonInspection
*/
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
$this->connection->getDatabasePlatform()->getName() !== 'mysql',
'Migration can only be executed safely on \'mysql\'.'
);
<down>
}
}

0 comments on commit 2126b10

Please sign in to comment.