Add a column to an existing entity in Symfony

前端 未结 9 1902
误落风尘
误落风尘 2020-12-22 21:27

I\'ve been playing around with Symfony on my web server and I\'ve been creating entity with doctrine for my database. I wanted to add a column to one of these entity... I wa

9条回答
  •  被撕碎了的回忆
    2020-12-22 22:02

    That's how it worked for me:

    • add new vars, setters and getters inside the existing class:
        src-->AppBundle-->Entity-->YourClassName.php
    
    • update the ORM File:
      src-->AppBundle-->Resources-->config-->doctrine-->YourClassName.orm.yml
    
    • run bash command:
      php bin/console doctrine:schema:update --force
    

提交回复
热议问题