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 3809090
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:15:04+00:00 2026-05-19T15:15:04+00:00

Hey. I’m having a hard time migrating changes I’ve done i my config/doctrine/schema.yml file.

  • 0

Hey.
I’m having a hard time migrating changes I’ve done i my config/doctrine/schema.yml file.

I added the column age to the user table. Then I did a php symfony doctrine:generate-migrations-diff followed by php symfony doctrine:migrate .

Looking in my database, the column age is now added, without deleting any data.

But, my /lib/model/doctrine/base/BaseUser.class.php is not changed, there is no age field or functions for age . So I also did the command php symfony doctrine:build-model . Finally the model is updated/migrated too.

So I wonder, is this the only way? Seems like a lot of work, and I’m afraid to miss something each time doing it.

Could I go right into phpmyadmin, add changes in the database there and just do a php symfony doctrine:build-schema , and like that skip the migration part (two commands).

Also when the comes to use of models, am I right that /lib/model/doctrine/User.class.php is where I can make functions and such for my User “data class”? Like, making a function isFemale . If not, where would that kind of function be?

This might be a bad question, but why is the model layer inside the /lib/doctrine path? As far as I have learned, you keep modules inside apps, where you create your view and controller. Why should the model be outside. Like this I can make models without attached controller and view?

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-05-19T15:15:05+00:00Added an answer on May 19, 2026 at 3:15 pm

    Why should the model be outside

    Because models can be used everywhere in your project, in example, in different applications and modules.

    Could I go right into phpmyadmin, add changes in the database there and just do a php symfony doctrine:build-schema , and like that skip the migration part (two commands).

    Of course you can, but migrations are a good approach to track your schema when deploying to production or working in team.

    Here how I use doctrine migrations (simple use-case):

    1. Add a column age to my User model in schema.yml
    2. ./symfony doctrine:generate-migrations-diff. Migration class(-es) have been generated.
    3. ./symfony doctrine:migrate. Column age successfully added to table.
    4. ./symfony doctrine:build --all-classes. Build forms/filters/models

    That’s it. The main idea is that doctrine:generate-migrations-diff class:

    1. Gathers information about all your models’ structure (php-representation of schema.yml)
    2. Compares your schema.yml and info from (1)
    3. Generates migration classes based on difference

    Also when the comes to use of models, am I right that /lib/model/doctrine/User.class.php is where I can make functions and such for my User “data class”? Like, making a function isFemale . If not, where would that kind of function be?

    Yes, you can add such method to User model because it’s about users.

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

Sidebar

Related Questions

Hey all I want to reseed my IDENTITY COLUMN values starting from 1 I
Hey everyone, I'm using Virtual PC and working with a virtual hard disk (*.vhd)
Hey all. Newbie question time. I'm trying to setup JMXQuery to connect to my
Hey having some trouble trying to maintain transparency on a png when i create
Hey all i have an XML file that i am trying to loop though.
Hey am just curious to know if this can be done! I want to
hey guys I have a problem adding text inside an added html-tag I have
hey i am having problems using the sizeof operator in malloc. For example see
Hey all, I want to change a value in a table (in a mysql
Hey everyone, I'm working on a widget for Apple's Dashboard and I've run into

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.