-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Update entity_provider.rst #3116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -642,14 +642,14 @@ Don't forget also to update your database schema: | |
|
||
php app/console doctrine:schema:update --force | ||
|
||
This will create the ``acme_role`` table and a ``user_role`` that stores | ||
the many-to-many relationship between ``acme_user`` and ``acme_role``. If | ||
This will create the ``acme_roles`` table and a ``user_role`` that stores | ||
the many-to-many relationship between ``acme_users`` and ``acme_roles``. If | ||
you had one user linked to one role, your database might look something like | ||
this: | ||
|
||
.. code-block:: text | ||
|
||
$ mysql> select * from acme_role; | ||
$ mysql> select * from acme_roles; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thought the best practice is to call the tables singular There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cordoval But the beginning of the example uses There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah i mean the PR should change the example overall, but i am fine with whatever, just pointing it out There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about changing table names to acme_user, acme_role and acme_user_role? This way the names will be more consistent. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I always prefer plural table names There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should I change table names to acme_users, acme_roles and acme_user_roles? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A great debate! :). My vote is for singular names. I don't know of any standard, though singular table names are used in the Doctrine documentation (http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/basic-mapping.html#creating-classes-for-the-database for example). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 for singular names for this is the default behaviour if you don't set the table name explicitly. |
||
+----+-------+------------+ | ||
| id | name | role | | ||
+----+-------+------------+ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was missing before, but it should say: