Skip to content

Commit

Permalink
Introduce Doctrine\DBAL\Migrations\AbstractMigration deprecation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwage committed Jun 6, 2018
1 parent c43891c commit 3e2cfb9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
5 changes: 3 additions & 2 deletions composer.json
Expand Up @@ -31,7 +31,8 @@
},
"autoload": {
"psr-4": {
"Doctrine\\DBAL\\Migrations\\": "lib/Doctrine/DBAL/Migrations"
"Doctrine\\DBAL\\Migrations\\": "lib/Doctrine/DBAL/Migrations",
"Doctrine\\Migrations\\": "lib/Doctrine/Migrations"
}
},
"autoload-dev": {
Expand All @@ -41,7 +42,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "v1.7.x-dev"
"dev-master": "v1.8.x-dev"
}
},
"bin": [
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/DBAL/Migrations/AbstractMigration.php
Expand Up @@ -3,6 +3,7 @@
namespace Doctrine\DBAL\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration as BaseAbstractMigration;

/**
* Abstract class for individual migrations to extend from.
Expand All @@ -11,6 +12,7 @@
* @link www.doctrine-project.org
* @since 2.0
* @author Jonathan H. Wage <jonwage@gmail.com>
* @deprecated Please use Doctrine\Migrations\AbstractMigration
*/
abstract class AbstractMigration
{
Expand Down Expand Up @@ -51,6 +53,8 @@ abstract class AbstractMigration

public function __construct(Version $version)
{
@trigger_error(sprintf('The "%s" class is deprecated since Doctrine Migrations 2.0. Use %s instead.', AbstractMigration::class, BaseAbstractMigration::class), E_USER_DEPRECATED);

$config = $version->getConfiguration();

$this->version = $version;
Expand Down
Expand Up @@ -24,8 +24,8 @@ class GenerateCommand extends AbstractCommand
namespace <namespace>;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
Expand Down
20 changes: 20 additions & 0 deletions lib/Doctrine/Migrations/AbstractMigration.php
@@ -0,0 +1,20 @@
<?php

namespace Doctrine\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration as BaseAbstractMigration;
use Doctrine\DBAL\Migrations\Version;

abstract class AbstractMigration extends BaseAbstractMigration
{
public function __construct(Version $version)
{
$config = $version->getConfiguration();

$this->version = $version;
$this->connection = $config->getConnection();
$this->sm = $this->connection->getSchemaManager();
$this->platform = $this->connection->getDatabasePlatform();
$this->outputWriter = $config->getOutputWriter();
}
}

0 comments on commit 3e2cfb9

Please sign in to comment.