Forum: Ruby on Rails Migrations and primary id

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
620c12639078ea2dde8a3b50ccee4c05?d=identicon&s=25 Dark Ambient (Guest)
on 2006-06-12 11:23
(Received via mailing list)
I set up a migration yesterday for the first time and remembered that
Rails
will assign a primary id column on it's own.  No need to put it in to
the
SQL.
The name of the column though is just "id", is there a way to over ride
the
default if I wanted ?

TIA
Stuart
4d3c4ad293c983f47f3eab02796eafc7?d=identicon&s=25 unknown (Guest)
on 2006-06-12 11:33
(Received via mailing list)
create_table :table_name, :primary_key => 'your_PK_name'
620c12639078ea2dde8a3b50ccee4c05?d=identicon&s=25 Dark Ambient (Guest)
on 2006-06-12 11:46
(Received via mailing list)
Thanks , but leaving Rails calling it just id , any potential problems ?

Stuart
This topic is locked and can not be replied to.