Skip to content

Commit

Permalink
Merge pull request #690 from doctrine/abstract-migration-deprecation
Browse files Browse the repository at this point in the history
Introduce Doctrine\DBAL\Migrations\AbstractMigration deprecation.
  • Loading branch information
jwage committed Jun 6, 2018
2 parents c43891c + f0bb055 commit 4040df9
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 169 deletions.
158 changes: 0 additions & 158 deletions CHANGELOG.md

This file was deleted.

24 changes: 16 additions & 8 deletions UPGRADE-1.0.md → UPGRADE.md
@@ -1,3 +1,11 @@
UPGRADE TO 1.8
==============

## AbstractMigration

The `Doctrine\DBAL\Migrations\AbstractMigration` class has been deprecated and replaced with
`Doctrine\Migrations\AbstractMigration`. It will be removed in 2.0 so please update to use the class in the new namespace.

UPGRADE FROM 1.0-alpha1 to 1.0.0-alpha3
=======================================

Expand All @@ -13,27 +21,27 @@ It would cause discrepancies between the file order in a file browser and the or
The `getName()` method as been removed | set final and new `getDescription()` method has been added.
The goal of this method is to be able to provide context for the migration.
This context is shown for the last migrated migration when the status command is called.

## --write-sql option from the migrate command

### Before:

The `--write-sql` option would only output sql contained in the migration and would not update the table containing the migrated migrations.

### After:

That option now also output the sql queries necessary to update the table containing the state of the migrations.
If you want to go back to the previous behavior just make a request on the bug tracker as for now the need for it is not very clear.

## MigrationsVersion::VERSION

### Before:

`MigrationsVersion::VERSION` used to be a property.
The returned value was fanciful.

### After:

It is now a a function so that a different value can be automatically send back if it's a modified version that's used.
The returned value is now the git tag.
The tag is in lowercase as the other doctrine projects.
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
6 changes: 6 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 NewAbstractMigration;

/**
* 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,10 @@ abstract class AbstractMigration

public function __construct(Version $version)
{
if ( ! $this instanceof NewAbstractMigration) {
@trigger_error(sprintf('The "%s" class is deprecated since Doctrine Migrations 2.0. Use %s instead.', AbstractMigration::class, NewAbstractMigration::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
10 changes: 10 additions & 0 deletions lib/Doctrine/Migrations/AbstractMigration.php
@@ -0,0 +1,10 @@
<?php

namespace Doctrine\Migrations;

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

abstract class AbstractMigration extends BaseAbstractMigration
{
}

0 comments on commit 4040df9

Please sign in to comment.