# Add\_primary\_key

**URL:** <https://www.ruby-forum.com/t/add-primary-key/134243>\
**Category:** Rails\
**Created:** [April 9, 2008, 8:45am UTC](https://www.ruby-forum.com/t/add-primary-key/134243 "2008-04-09T08:45:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lgas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a87d85/32.png) [@lgas](https://www.ruby-forum.com/u/lgas)\
**Post date:** [April 9, 2008, 8:45am UTC](https://www.ruby-forum.com/t/add-primary-key/134243/1 "2008-04-09T08:45:17Z")

</div>

Hi,

We use “add\_primary\_key” method in the active record script to create  
primary key in a table. But this method does not allow us to create our  
own primary key constraint name.

Is there a way where we can give our own constraint name ?

please help !! Appreciate your response.

Thanks,  
John
