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

Allows us to define our own timestamp columns. #856

Merged
merged 1 commit into from
Aug 26, 2013

Conversation

durango
Copy link
Member

@durango durango commented Aug 25, 2013

This commit allows the user to predefine their own timestamp columns which is
useful for databases that already exist. This also allows the user to have their
own naming conventions for the timestamp columns.

The following options have been added when defining a new table:

  • createdAt (defaults to "createdAt")
  • updatedAt (defaults to "updatedAt")
  • deletedAt (defaults to "deletedAt")
  • touchedAt (defaults to "touchedAt")

Note: The underscored option still remains useful since it's just a simple one
line option which allows flexibility for those rare cases in which people decide
to change the structure of their database from camelCase to under_score or
vice-versa.

This commit allows the user to predefine their own timestamp columns which is
useful for databases that already exist. This also allows the user to have their
own naming conventions for the timestamp columns.

The following options have been added when defining a new table:

* createdAt (defaults to "createdAt")
* updatedAt (defaults to "updatedAt")
* deletedAt (defaults to "deletedAt")
* touchedAt (defaults to "touchedAt")

Note: The underscored option still remains useful since it's just a simple one
line option which allows flexibility for those rare cases in which people decide
to change the structure of their database from camelCase to under_score or
vice-versa.
@durango
Copy link
Member Author

durango commented Aug 25, 2013

If this gets pulled we should add an issue to sequelize-doc for these changes :)

@sdepold
Copy link
Member

sdepold commented Aug 26, 2013

what the hell is touchedAt ?

@sdepold
Copy link
Member

sdepold commented Aug 26, 2013

could you add another test for updatedAt ?

@durango
Copy link
Member Author

durango commented Aug 26, 2013

what the hell is touchedAt ?

https://github.com/sequelize/sequelize/pull/856/files#L1L376

No idea but it's right there...

updatedAt is included in both tests...

https://github.com/sequelize/sequelize/pull/856/files#L2R111

sdepold added a commit that referenced this pull request Aug 26, 2013
Allows us to define our own timestamp columns.
@sdepold sdepold merged commit 7a69529 into sequelize:master Aug 26, 2013
@durango durango mentioned this pull request Sep 18, 2013
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

Successfully merging this pull request may close these issues.

2 participants