Skip to content

Instantly share code, notes, and snippets.

@serapheem
Created November 6, 2012 10:34
Show Gist options
  • Save serapheem/4023932 to your computer and use it in GitHub Desktop.
Save serapheem/4023932 to your computer and use it in GitHub Desktop.
Symfony2 - Common doctrine console commands
Create the database:
php app/console doctrine:database:create
Create the entity:
php app/console doctrine:generate:entity --entity="AcmeStoreBundle:Product" --fields="name:string(255) price:float description:text"
Update the entities:
php app/console doctrine:generate:entities Acme/StoreBundle/Entity/Product
php app/console doctrine:generate:entities AcmeStoreBundle
php app/console doctrine:generate:entities Acme
Update database based on entities:
php app/console doctrine:schema:update --force
Update entities based on database:
php app/console doctrine:mapping:import TestNewsBundle annotation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment