1

I have a deployment script that executes the migrations this way:

php bin/console doctrine:migrations:diff --allow-empty-diff --env=prod
php bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration --env=prod

And I am getting this error:

[ERROR] No changes detected in your mapping information.

Previously, before upgrading to migrations 3, the error was not being thrown. Once I upgraded it the error started to appear.

"doctrine/doctrine-bundle": "2.1.*",
"doctrine/doctrine-migrations-bundle": "3.1.*", // previously "2.2.*"
"doctrine/migrations": "3.2.*", // previously "2.2.*"

At first I thought that the --allow-empty-diff was removed in the new version, but when I run:

php bin/console doctrine:migrations:diff --help

I do see

--allow-empty-diff     Do not throw an exception when no changes are detected.

Any ideas?

Ignas Damunskis
  • 1,515
  • 1
  • 17
  • 44
  • 1
    It displays an error, but it returns a 0 code, no ? https://github.com/doctrine/migrations/blob/4eeb7968ade885b45ab213d69ae852ff0ea9be08/lib/Doctrine/Migrations/Tools/Console/Command/DiffCommand.php#L162-L165 – homer Dec 20 '22 at 21:07
  • You are correct, checkout the older version (2.2.x) and it was just doing `writeln` – Ignas Damunskis Dec 22 '22 at 12:00

2 Answers2

2

It seems the functionality stills works the same as before. If no changes are detected, a message is printed to the console.

However, the difference between 2.2.* and 3.6.* is that it the latter uses StyleInterface to style the message as an error instead of using the regular OutputInterface.

In both cases, a exception is not thrown.

See the code for 2.2.*
See the code for 3.6.*

Brent
  • 143
  • 9
0

Just give a try updating your schema

php bin/console orm:schema-tool:update --force
Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85