# How to use a long/bigint id in Rails applications?

**URL:** <https://www.ruby-forum.com/t/how-to-use-a-long-bigint-id-in-rails-applications/174752>\
**Category:** Rails\
**Created:** [September 1, 2009, 5:54pm UTC](https://www.ruby-forum.com/t/how-to-use-a-long-bigint-id-in-rails-applications/174752 "2009-09-01T17:54:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jah4711](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/898d66/32.png) [@jah4711](https://www.ruby-forum.com/u/jah4711)\
**Post date:** [September 1, 2009, 5:54pm UTC](https://www.ruby-forum.com/t/how-to-use-a-long-bigint-id-in-rails-applications/174752/1 "2009-09-01T17:54:01Z")

</div>

I am looking for a way to use a long/bigint primary key instead of the  
default integer id.

I did some googling and there are some results (e.g.  
[activerecord - How to use long id in Rails applications? - Stack Overflow](http://stackoverflow.com/questions/1066340/how-to-use-long-id-in-rails-applications)),  
but I am not sure about the solutions and I don’t want to have  
problems in a couple of months. Btw. I really want to use a standard  
mechanism and not a Rails hack, so that I can use the models without  
any special treatment.

Appreciate any help, Thanks.

Heli
