Skip to content

Commit eeb2767

Browse files
mpdudejaviereguiluz
authored andcommitted
[Doctrine] Suggest reusable bundles use explicit name configurations for Doctrine entities
1 parent 6682b7b commit eeb2767

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

bundles/best_practices.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,13 @@ recommended to define their mapping using XML files stored in
167167
:doc:`standard Symfony mechanism to override bundle parts </bundles/override>`.
168168
This is not possible when using annotations/attributes to define the mapping.
169169

170+
Also, include explicit ``name`` values in the configuration for database tables
171+
and columns, to make sure your code is independent of the Doctrine naming strategy
172+
in use. Otherwise, for example when referring to columns in plain SQL queries,
173+
using different naming strategies may break your code. This may mean that the
174+
database schema elements belonging to your bundle follow another convention than
175+
the rest of the project.
176+
170177
.. caution::
171178

172179
The recommended bundle structure was changed in Symfony 5, read the

0 commit comments

Comments
 (0)