# How can I use a the current\_timestamp feature of a database without a magial column

**URL:** <https://www.ruby-forum.com/t/how-can-i-use-a-the-current-timestamp-feature-of-a-database-without-a-magial-column/116869>\
**Category:** Rails\
**Created:** [October 10, 2007, 4:42pm UTC](https://www.ruby-forum.com/t/how-can-i-use-a-the-current-timestamp-feature-of-a-database-without-a-magial-column/116869 "2007-10-10T16:42:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dirk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/87869e/32.png) [@dirk](https://www.ruby-forum.com/u/dirk)\
**Post date:** [October 10, 2007, 4:42pm UTC](https://www.ruby-forum.com/t/how-can-i-use-a-the-current-timestamp-feature-of-a-database-without-a-magial-column/116869/1 "2007-10-10T16:42:38Z")

</div>

Hi ,

I’m looking for a way to create columns with a default current\_stamp  
with the db:migrate feature.

---

<div class="post-metadata">

**Author:** ![dirk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/87869e/32.png) [@dirk](https://www.ruby-forum.com/u/dirk)\
**Post date:** [October 10, 2007, 7:45pm UTC](https://www.ruby-forum.com/t/how-can-i-use-a-the-current-timestamp-feature-of-a-database-without-a-magial-column/116869/2 "2007-10-10T19:45:47Z")

</div>

Create a column called created\_at with :datetime as the type. You can  
also create updated\_at in the same way. It will be updated every time  
the record is.

-Bill

Dirk wrote:

> Hi ,
> 
> I’m looking for a way to create columns with a default current\_stamp  
> with the db:migrate feature.
> 
> >

–  
Sincerely,

William P.
