php - Doctrine/Symfony entity generator and generating entity from one table -
i have few entities, new table appeared in database, , i'd generate entity on 1 table.
i saw this, have further questions.
i have user entity (and db table). now, new table called "report" (no entity right now, want create it) , has foreign key user. there few more foreign keys.
if suggested in above answer, is:
$ php app/console doctrine:mapping:import --force appbundle xml --filter="report" $ php app/console doctrine:mapping:convert annotation ./src/appbundle/entity --from-database --filter="report" $ php app/console doctrine:generate:entities appbundle:report --no-backup
will doctrine generator try modify user entity? or create report entity?
btw. understand(?), not, because manytoone relation, let's assume moment manytomany moment.
i know try it, last time executed doctrine:mapping:import --force
command ended crashing app , spent many hours solve problem, until on stackoverflow told me remove src\appbundle/resources/config/doctrine/
directory, helped.
i didn't think making backup before running command.
so, i'm bit afraid of it... created backup, i'm not sure if in case of troubles.
it depends on /resources/config/doctrine
directory. if empty out , commands described, report
entity modified. if have of previous mappings in directory should modify user
entity well.
the commands automatically create backups of entities you, have new user.php
, backup in user.php~
, should careful of if using version control , git add src/
without thinking hard it. don't want add files source control.
either way, backups created, , should using version control on top of that, should fine.
Comments
Post a Comment