Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8283683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:49:24+00:00 2026-06-08T10:49:24+00:00

What is the difference between symfony doctrine:generate-migrations-db and symfony doctrine:generate-migrations-models I can’t notice any

  • 0

What is the difference between

symfony doctrine:generate-migrations-db

and

symfony doctrine:generate-migrations-models

I can’t notice any difference: I’ve tried with tables IN DB, NO schema.yml and NO models, both of them have no effect. No migrations generated.

I’ve tried with tables IN DB, GENERATED schema.yml and NO models, both of them have no effect. No migrations generated.

And lastly I’ve tried with tables IN DB, GENERATED schema.yml and GENERATED models, now both of them generate the same migrations classes :|.

Can’t really understand the difference. Or at least, what is the best way to start using migrations considering all scenarious: having models, but no DB and having DB, but no models.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T10:49:27+00:00Added an answer on June 8, 2026 at 10:49 am

    Given an existing database with 1+ tables, running

    ./symfony doctrine:generate-migrations-db
    

    will result in migration files being created for each table. Similarly, given a directory like /lib/model/doctrine filled with pre-existing model classes, running

    ./symfony doctrine:generate-migrations-models
    

    will result in migraiton files being created for each model.

    With tables in the database, with or without schema.yml contents, and no models in lib/model/doctrine, you just need to ensure you’re database.yml file has credentials to correctly connect to your database.

    Once you figure out the problem with your migrations files not generating, what I would do is something like to get started with migrations.

    1. Generate a fresh schema from your existing database with ./symfony doctrine:build-schema
    2. Manually clean up the schema file, and re-establish your relations you’re already got existing in your model files (if any).
    3. Reconfigure config/databases.yml to point to a new blank database
    4. Build migrations with ./symfony doctrine:generate-migrations-diff. This will create migrations based on your schema file to bring your (blank) database up to date
    5. Run ./symfony doctrine:migrate and watch for errors. Fix them by fixing your schema file. Delete the migrations created in Step 4. Flush your databse ./symfony doctrine:drop-db && ./symofny doctrine:build-db and go back to Step 4. Continue until you’re schema generates a clean set of migrations files that can run without error.
    6. Rebuild your models with ./symfony doctrine:build --model --forms --filters

    Now you have a clean schema.yml file, clean migrations that can bring a blank database up to date, and models that directly relate to your schema.yml file and database.

    When you want to make a new change to your database, it’s now as simple as

    1. Make the desired change in your schema.yml
    2. Run ./symfony doctrine:generate-migrations-diff
    3. Manually review the generated migrations
    4. Run ./symfony doctrine:migrate to make sure the migrations run without error
    5. Rebuild your model, forms, and filters ./symfony doctrine:build --model --forms --filters

    Going through this process can be frustrating at times, but it’s something you only have to do once to create a really good based to build upon.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm generating migrations between different yaml schema files: i.e. running: symfony doctrine:generate-migrations-diff And the
Can any one explain difference between position and anchor point in cocos-2D with some
what is the difference between the symfony myUser and doctrine model User? where should
Is there any tangible difference between the two forms of syntax available for creating
Is there any difference between ReferencePath with condition '%(CopyLocal)'=='true' and ReferenceCopyLocalPaths ? The question
Difference between list & arraylist in android. How can i sort out arraylist?
Any difference between these two lines of code? 1) someString.Split(new[] { ';' }); 2)
Any difference between a = session.query(Accounts).filter(Accounts.key = 4).first() and a = session.query(Accounts).filter(Accounts.key = 4)[0]
Are there any practical difference between the two coding patterns in Delphi: Version 1
Any difference between the two, int terms of speed/performance? $sql = SELECT * .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.