Results 1 to 2 of 2
Thread: Primary Key Type other than INT?
Jun 12, 2006, 01:43 #1
- Join Date
- Apr 2005
- 0 Post(s)
- 0 Thread(s)
Primary Key Type other than INT?
I started to use Rails recently and at the moment I am focusing Mgrations.
Is it possible to change the type of the primary key? Changing the name is fairly easy. I have data that are referencend by a char field that has unique content.
That's what my first migration looks like.
def self.up create_table(:pages, :primary_key => :id) do |t| t.column :id, :string t.column :name, :string t.column :content, :string end
Last edited by Josti; Jun 12, 2006 at 03:40.