question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add guide for helping with created_at and updated_at timestamps

See original GitHub issue

Let’s add a guide to help users model created_at and updated_at timestamps.

For created_at a default value of now() works. For updated_at a trigger on the lines of: https://x-team.com/blog/automatic-timestamps-with-postgresql/

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
hrmollercommented, Jul 28, 2019

Thanks for the Frequently used columns feature👍 However, it would be super nice if this feature was also available on the Modify-tab so it can be used on tables already created.

Screenshot 2019-07-28 19 34 30
7reactions
sebastianmaciascommented, Nov 26, 2018

created_at and updated_at automatic timestamps are so commonly used. I think there should be an option to set the timestamp field to automatically handle this when creating the schema.

By the way the link posted is broken, this is the working link: https://x-team.com/blog/automatic-timestamps-with-postgresql/

Read more comments on GitHub >

github_iconTop Results From Across the Web

add created_at and updated_at fields to mongoose schemas
This will automatically add createdAt and updatedAt fields to your schema. http://mongoosejs.com/docs/guide.html#timestamps.
Read more >
Introducing $createdAt And $updatedAt On Each Resource
In our latest 0.15 release, we introduced many exciting new features, one among them is the addition of two new timestamp attributes $createdAt...
Read more >
Mongoose Timestamps
Mongoose schemas support a timestamps option. If you set timestamps: true , Mongoose will add two properties of type Date to your schema:...
Read more >
Schema - Dynamoose
This setting lets you indicate to Dynamoose that you would like it to handle storing timestamps in your items for both creation and...
Read more >
How to persist creation and update timestamps with Hibernate
Storing the creation timestamp or the timestamp of the last update is a common requirement for modern applications. It sounds like a simple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found