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.
Dark A. (Guest)
on 2006-06-12 13: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
unknown (Guest)
on 2006-06-12 13:33
(Received via mailing list)
create_table :table_name, :primary_key => 'your_PK_name'
Dark A. (Guest)
on 2006-06-12 13: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.