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 + versionable Behaviors produces unnecessary columns #362

Closed
MattiasBiri opened this issue May 16, 2012 · 3 comments
Closed

Comments

@MattiasBiri
Copy link

If I applay both versionable and timestampable behavious to a table
the updated_at column is always the same as the created_at column.

This is obvious becouse every update is a new entity if we use versioning,
but in this case the updated_at column is unnecessary.

Not a very important thing, but with big databases it could be annoying...

@willdurand
Copy link
Contributor

Heya, nice report, thanks.

@themouette did you use both timestampable, and versionable? It could be nice to tweak the behavior as @MattiasBiri suggested, isn't it?

@MattiasBiri
Copy link
Author

I found that if you set both created_at and updated_at column name to the same, it will produces the created at column only.
So this is a tested workaround:

    <behavior name="versionable" />
    <behavior name="timestampable">
        <parameter name="create_column" value="created_at" />
        <parameter name="update_column" value="created_at" />
    </behavior>

@willdurand
Copy link
Contributor

Well, I guess it's a nice workaround but the behavior should handle that :)

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

2 participants