Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge release 2.2.1 into 2.3.x #907

Merged
merged 2 commits into from
Jan 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions lib/Doctrine/Migrations/AbstractMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
namespace Doctrine\Migrations;

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\Exception\AbortMigration;
use Doctrine\Migrations\Exception\IrreversibleMigration;
use Doctrine\Migrations\Exception\MigrationException;
use Doctrine\Migrations\Exception\SkipMigration;
use Doctrine\Migrations\Version\Version;
use function sprintf;
Expand Down Expand Up @@ -100,24 +102,42 @@ public function skipIf(bool $condition, string $message = '') : void
}
}

/**
* @throws MigrationException|DBALException
*/
public function preUp(Schema $schema) : void
{
}

/**
* @throws MigrationException|DBALException
*/
public function postUp(Schema $schema) : void
{
}

/**
* @throws MigrationException|DBALException
*/
public function preDown(Schema $schema) : void
{
}

/**
* @throws MigrationException|DBALException
*/
public function postDown(Schema $schema) : void
{
}

/**
* @throws MigrationException|DBALException
*/
abstract public function up(Schema $schema) : void;

/**
* @throws MigrationException|DBALException
*/
abstract public function down(Schema $schema) : void;

/**
Expand All @@ -137,6 +157,9 @@ protected function write(string $message) : void
$this->outputWriter->write($message);
}

/**
* @throws IrreversibleMigration
*/
protected function throwIrreversibleMigrationException(?string $message = null) : void
{
if ($message === null) {
Expand Down