2

There was a recent upgrade to doctrine-migrations version 3, that came as part of a vendor library upgrade, so we are kind of forced to follow now ;)

We configured it like this:

doctrine_migrations:
    migrations_paths:
        "DoctrineMigrations": "src/Migrations"

    storage:
        table_storage:
            table_name: 'migration_versions'
            version_column_name: 'version'
            version_column_length: 1024
            executed_at_column_name: 'executed_at'
            execution_time_column_name: 'execution_time'

Never the less, we get the folowing strange migration error.

bin/console doctrine:migrations:status gives this "everything fine" output:

+----------------------+----------------------+------------------------------------------------------------------------+
| Configuration                                                                                                        |
+----------------------+----------------------+------------------------------------------------------------------------+
| Storage              | Type                 | Doctrine\Migrations\Metadata\Storage\TableMetadataStorageConfiguration |
|                      | Table Name           | migration_versions                                                     |
|                      | Column Name          | version                                                                |
|----------------------------------------------------------------------------------------------------------------------|
| Database             | Driver               | Doctrine\DBAL\Driver\PDOMySql\Driver                                   |
|                      | Name                 | dwconnect2                                                             |
|----------------------------------------------------------------------------------------------------------------------|
| Versions             | Previous             | DoctrineMigrations\Version20200522213838                               |
|                      | Current              | DoctrineMigrations\Version20200608142225                               |
|                      | Next                 | Already at latest version                                              |
|                      | Latest               | DoctrineMigrations\Version20200608142225                               |
|----------------------------------------------------------------------------------------------------------------------|
| Migrations           | Executed             | 18                                                                     |
|                      | Executed Unavailable | 0                                                                      |
|                      | Available            | 18                                                                     |
|                      | New                  | 0                                                                      |
|----------------------------------------------------------------------------------------------------------------------|
| Migration Namespaces | DoctrineMigrations   | src/Migrations                                                         |
+----------------------+----------------------+------------------------------------------------------------------------+

But if we run bin/console doctrine:migrations:migrate --no-interaction it throws the following error:

[ERROR] The version "latest" couldn't be reached, you are at version "DoctrineMigrations\Version20200608142225"  

Our database is looking good, as we cleared it out and where running all the migrations fresh.

Thx a lot for any help!
Andreas

Andreas
  • 1,691
  • 1
  • 15
  • 34
  • Looks like this is a breaking change introduced into 3.0.0: https://github.com/doctrine/migrations/issues/987 – Andreas Jun 17 '20 at 15:41
  • You are not forced to upgrade, just unpack orm with `composer unpack orm` and pin doctrine-migrations version to `^2` – Manuel Jun 19 '20 at 09:41

1 Answers1

2

So credits to this reply on the original github issue:

bin/console doctrine:migrations:migrate --allow-no-migration --no-interaction

This will convert the error into a warning.

Andreas
  • 1,691
  • 1
  • 15
  • 34
  • Version 3.0.1 handles this now gracefully ;) - looks like we have been just a bit too cutting edge. – Andreas Jun 24 '20 at 16:05