DEV Community

Mati Andreas
Mati Andreas

Posted on

3 1

Testing doctrine migration in Symfony project

  1. Checkout to the master branch
    git checkout master.

  2. Update database to match current doctrine schema, also removing excess tables
    php bin/console d:s:u --force --complete, where d:s:u is automatic short version of doctrine:schema:update, provided by Symfony console.

    NB! It deletes all tables from the database that are not in doctrine schema!
    If you want to keep some tables (migration table could also be removed), then run php bin/console d:s:u --dump-sql --complete
    do display excess tables, remove them manually and then run php bin/console d:s:u --force to make schema up-to-date with master.

  3. Add all migrationsphp bin/console d:m:v --all --add -n
    where d:m:v is automatic short version of doctrine:migrations:version, provided by Symfony console.

  4. Checkout to your feature branch git checkout KEY-123

  5. Run migrations php bin/console d:m:m -n, where d:m:m is automatic short version of doctrine:migrations:migrate, provided by Symfony console.

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay