0

[I just want to update column in my existing entity class, but when I migrate to database using php bin/console ..., It's always shows table already exists or column could not be repeated ] What should I do with this problem?

天才div
  • 1
  • 1

2 Answers2

0

Make sure, what migration are you executing. If you are not sure, you can delete all migrations in migrations folder of your project. And in your database, empty doctrine_migrations table. Then, try to generate and execute migrations again.

Adrian98do
  • 116
  • 1
  • 5
0

You can execute the down action of the migration with:

bin/console doctrine:migration:execute --down "name_of_the_migration" .

Where the name of the migration is DoctrineMigrations\VersionXXXXXXXXXXXXXX. Then update what you need and migrate the migration again with the new changes.

Dan
  • 52
  • 7