« Programmation PHP avec Symfony/Doctrine » : différence entre les versions

Contenu supprimé Contenu ajouté
Ligne 554 :
==== Vers le code ====
===== Vers les entités =====
 
<syntaxhighlight lang=bash>
php bin/console doctrine:mapping:import App\\Entity annotation --path=src/Entity
</syntaxhighlight>
 
===== Vers les migrations =====
Pour créer la migration permettant de parvenir à la base de données actuelle :
 
<syntaxhighlight lang=bash>
php bin/console doctrine:migrations:diff
</syntaxhighlight>
 
==== Vers la base ====
À contrario, pour mettre à jour la BDD à partir des entités :
 
<syntaxhighlight lang=bash>
php bin/console doctrine:schema:update --force
 
</syntaxhighlight>
 
Pour le prévoir dans une migration :
 
<syntaxhighlight lang=bash>
php bin/console doctrine:schema:update --dump-sql
</syntaxhighlight>
 
== Fixtures ==