Skip to content
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

[Timestampable] change names fields in TimestampableEntity trait #1263

Closed
maidmaid opened this issue Mar 9, 2015 · 7 comments
Closed

[Timestampable] change names fields in TimestampableEntity trait #1263

maidmaid opened this issue Mar 9, 2015 · 7 comments

Comments

@maidmaid
Copy link
Contributor

maidmaid commented Mar 9, 2015

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;
@maidmaid maidmaid changed the title [Timestampable] change name field in TimestampableEntity trait [Timestampable] change names fields in TimestampableEntity trait Mar 9, 2015
@l3pp4rd
Copy link
Contributor

l3pp4rd commented Mar 13, 2015

well yes indeed, would accept the PR

maidmaid added a commit to maidmaid/DoctrineExtensions that referenced this issue Mar 23, 2015
l3pp4rd added a commit that referenced this issue Mar 25, 2015
#1263 set column names in timestampable trait
@marek-saji
Copy link

Isn't this NamingStrategy's job?

@maidmaid
Copy link
Contributor Author

maidmaid commented Apr 4, 2015

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

@marek-saji
Copy link

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 [email protected] 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)
.

@l3pp4rd
Copy link
Contributor

l3pp4rd commented Apr 5, 2015

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

@l3pp4rd
Copy link
Contributor

l3pp4rd commented May 1, 2015

reverted in 2.4.1

@marek-saji
Copy link

👍

@l3pp4rd l3pp4rd closed this as completed Jun 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants