After the bin/console doctrine:migrations:diff was created. After - bin/console doctrine:migrations:migrate

Then I had to make a change to the entity and re-do the migration with the same bin/console doctrine:migrations:diff command bin/console doctrine:migrations:diff . But for some reason I get the following errors:

 An exception occurred while executing 'SELECT min_value, increment_by FROM "user_entity_id_seq"': SQLSTATE[42703]: Undefined column: 7 ERROR: column "min_value" does not exist LINE 1: SELECT min_value, increment_by FROM "user_entity_id_seq" SQLSTATE[42703]: Undefined column: 7 ERROR: column "min_value" does not exist LINE 1: SELECT min_value, increment_by FROM "user_entity_id_seq" SQLSTATE[42703]: Undefined column: 7 ERROR: column "min_value" does not exist LINE 1: SELECT min_value, increment_by FROM "user_entity_id_seq" 
  • and the previous migration canceled? - Dmitry Kozlov
  • @DmitryKozlov, I tried to remove php bin/console doctrine migrations:version YYYYMMDDHHMMSS --delete but I can’t find out the version because I get the same error - HegoJune
  • try: 1 doctrine:migrations:migrate prev 2. remove the php from the previous migration 3. заново bin/console doctrine:migrations:diff - Dmitry Kozlov
  • @DmitryKozlov, yes, this is it. Once again, helping me out. Thank! Add as an answer) - HegoJune

1 answer 1

If you need to change something in the migration, you can:

Cancel previous migration:

 bin/console doctrine:migrations:migrate prev 

Delete the php file of the previous migration

Make changes to Entity

Re-run:

 bin/console doctrine:migrations:dif