doctrine-extensions / DoctrineExtensions

Doctrine2 behavioral extensions, Translatable, Sluggable, Tree-NestedSet, Timestampable, Loggable, Sortable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Timestampable] change names fields in TimestampableEntity trait

maidmaid opened this issue · comments

With actual trait TimestampableEntity, created columns in database are named createdAt and updatedAt. To comply a little better naming conventions, columns should be named created_at and updated_at, no ?

Changes are easy :

    /**
     * ...
     * @ORM\Column(name="created_at", type="datetime")
     */
    protected $createdAt;

    /**
     * ...
     * @ORM\Column(name="updated_at", type="datetime")
     */
    protected $updatedAt;

well yes indeed, would accept the PR

Yes, you're right @marek-saji : UnderscoreNamingStrategy does exactly that. But what is the best practice ? Using naming strategy or setting name column ?

Why not just revert to how it was before - that way naming strategy used in
the project would decide how to name the column. Or does it not work for
traits?

On Sat, 4 Apr 2015 14:36 Dany Maillard notifications@github.com wrote:

Yes, you're right @marek-saji https://github.com/marek-saji :
UnderscoreNamingStrategy does exactly that. But what is the best practice
? Using naming strategy or setting name column ?


Reply to this email directly or view it on GitHub
#1263 (comment)
.

well, I do not want to switch it back and forth, I agree that it was wrong to change it all if such thing as naming strategy exist, haven't knew about it before. It is not a huge problem in BC, for next minor version change, it might be switched back.. it seems to be a mistake actually, but making a change again, would be another mistake

reverted in 2.4.1