1

I'm using Doctrine Migrations and all migrations worked nice until now. The last one I've created is not recognized on the staging server, but it works perfect on my local machine.

enter image description here

The bundle recognizes as the latest migration the version 20151006091137, but it should be 20151011132851. As you can see in the image the migration file exists on the server.

On my local machine Doctrine sees correctly the latest version.

Does anyone has any idea?

Stev
  • 1,062
  • 11
  • 23
  • It seems that nano was seeing the file, but when doing ls I couldn't see the file. Very strange. When I cd into app/DoctrineMigrations the file was there and the bundle started to see the file. Perhaps it was some unreadable state until I manually entered the folder. – Stev Oct 11 '15 at 19:33
  • Is your problem solved then ? – Harijoe Oct 11 '15 at 21:47
  • Yes. My problem is solved. – Stev Oct 12 '15 at 03:56

2 Answers2

4

check into the table

doctrine_migrations

if your versionMigrations entry exist. clear the cache

app/console doctrine:cache:clear-metadata

check if your entities is sync to database

app/console doctrine:schema:validate

add new migration and you shouldn't have any addSql()

app/console doctrine:migrations:diff

Sync your migrations to database

app/console doctrine:migrations:migrate -y
rommct
  • 228
  • 1
  • 7
0

The same thing happened to me. In my case, it was environment issue. In other words, I was trying to run migration without using --env:

bin/console doctrine:migrations:status // No migrations

But when I run with --env=prod

bin/console doctrine:migrations:status --env=prod // Found migration

So i think it's related to caching issue or PHP configuration issue