Add a column to an existing entity in Symfony

前端 未结 9 1836
误落风尘
误落风尘 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 21:43

    f you need to add a new field property to an existin entity you can use make:entity

    $ php bin/console make:entity

    Class name of the entity to create or update

    "existingentity"

    New property name (press to stop adding fields):

    description

    Field type (enter ? to see all types) [string]:

    text

    Can this field be null in the database (nullable) (yes/no) [no]:

    no

    New property name (press to stop adding fields):

    (press enter again to finish)

    information extracted from https://symfony.com/doc/current/doctrine.html

提交回复
热议问题