Skip to content

Improvement suggestion: ask table name while making an entity #1757

@volodkaly

Description

@volodkaly

Hello, Dear Symfony team,

Let me propose a small improvement.
When running:

php bin/console make:entity User

the generated entity automatically uses the entity name as the table name (user).
However, in real-world projects table naming conventions often differ:
pluralized tables (users)
prefixed tables (app_user)
avoiding reserved SQL keywords (e.g. user in MySQL)
At the moment, developers must manually edit the generated entity and add:
#[ORM\Table(name: 'users')]

Proposal:
Add an optional interactive prompt during make:entity:
Table name (default: user):
Pressing Enter preserves current behavior: default lowercase entity name is prompted.

Best regards,
Vladimir Lasac

CC: @weaverryan @tucksaun @kbond @Nyholm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions