Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Model.build strips off timestamps #7284

Copy link
Copy link
@thebigredgeek

Description

@thebigredgeek
Issue body actions

Thanks for wanting to report an issue you've found in Sequelize. Please delete this text and fill in the template below. If unsure about something, just do as best as you're able.

Note that it will be much easier for us to fix the issue if a test case that reproduces the problem is provided. Ideally this test case should not have any external dependencies. We understand that it is not always possible to reduce your code to a small test case, but we would appreciate to have as much data as possible. Thank you!

Github should only be used for feature requests and bugs - all questions belong on StackOverflow, Slack, or Google groups.

This template is for submitting issues - if you want to submit a feature request you may skip this template

What you are doing?

Post a minimal code sample that reproduces the issue, including models and associations

console.log(instance.dataValues, instance.toJSON(), Model.build(instance.toJSON()));

What do you expect to happen?

The fields should be identical in all 3 cases. The instance is a freshly selected row out of the database. No updates have occurred.

What is actually happening?

After passing instance.toJSON() into Model.build, the new returned instance does not contain createdAt or updatedAt timestamps. I am manually adding these stamps, and am not using the timestamps option.

Dialect: postgres
Database version: 9
Sequelize version: 3.30

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugDEPRECATED: replace with the "bug" issue typeDEPRECATED: replace with the "bug" issue type

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.