Skip to content

Instantly share code, notes, and snippets.

@putWorkDev
Last active March 1, 2017 00:13
Show Gist options
  • Save putWorkDev/2005ed1531ee81f3edcc to your computer and use it in GitHub Desktop.
Save putWorkDev/2005ed1531ee81f3edcc to your computer and use it in GitHub Desktop.
Tips symfony cli
Once the metadata files are generated, you can ask Doctrine to build related entity classes by executing the following two commands:
php app/console doctrine:generate:entities CoreUserBundle
Check if database is already in sync with the current entity metadata:
php app/console doctrine:schema:update --dump-sql
Create tables in db:
php app/console doctrine:schema:update --force
You now have a usable Product class with mapping information so that Doctrine
knows exactly how to persist it. Of course, you don't yet have the
corresponding product table in your database. Fortunately, Doctrine can
automatically create all the database tables needed for every known entity
in your application. To do this, run:
php app/console doctrine:schema:update --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment