Tech Notes

Symfony Doctrine — Useful Commands

A quick reference of Symfony 1.x Doctrine commands for generating apps, building models and databases, and deploying.

I always forget the Symfony Doctrine commands, so this post is a reference for me as well as for you :). It isn’t a complete list, but I’ll add to it over time.

Create an application:

$ php symfony generate:app

Create a module:

$ php symfony generate:module

Create the database for the current model:

$ php symfony doctrine:build-db

Generate the classes for the current model:

$ php symfony doctrine:build-model

Generate schema.yml from the current database:

$ php symfony doctrine:build-schema

Generate the SQL for the current model:

$ php symfony doctrine:build-sql

Insert the SQL for the current model:

$ php symfony doctrine:insert-sql

Do a dry run of a project deployment:

$ php symfony project:deploy  -t

Deploy the project:

$ php symfony project:deploy  -t --go

Generate language files:

$ php symfony i18n:extract --auto-save