php - Symfony: Add Column to Doctrine Entity -
i'm trying learn basics of symphony, , have come across problem baffles me.
i'm trying write data sql table, following (mostly) instructions documentation ( http://symfony.com/doc/current/book/doctrine.html ). created entity via
$ php bin/console doctrine:generate:entity
and mapped db table correctly, can read , write, no problem. after added column table , corresponding lines entity:
/** * @var string * * @orm\column(name="user_credentials", type="text") */ private $usercredentials;
then tried creating setters , getters, no changes made, backup of entity. added getter , setter myself, when attempting write db corresponding column ommited, remaining empty. no errors given. checked , re-checked typos or other sytax errors, not find any. when doing
$ php bin/console doctrine:schema:update --dump-sql
i get
alter table st_users drop user_credentials;
so seems column ignored. cleared cache repatedly, changed nothing. am, obviously, lost. hint right path appreciated.
thank you.
you can use doctrinemigrationsbundle operations. bundle manage database operations. (drop, alter, create etc.)
anyway, when add new column can try this: php app/console doctrine:schema:update --force
Comments
Post a Comment