#236 new
Jacques Crocker

Primary Keys Fail

Reported by Jacques Crocker | July 7th, 2008 @ 04:04 PM

I seem to get this no matter what I do:

-- change_column("bj_config", :bj_config_id, :primary_key)

rake aborted!

Mysql::Error: #42000Multiple primary key defined: ALTER TABLE `bj_config` CHANGE `bj_config_id` `bj_config_id` int(11) DEFAULT NULL auto_increment PRIMARY KEY DEFAULT NULL

Here is the problem table:

    create_table "bj_config", :primary_key => "bj_config_id", :force => true do |t|
      t.string "hostname"
      t.string "key"
      t.text   "value"
      t.text   "cast"
    end

When I removed the :primary_key, it worked.

I dropped the database and recreated it and still kept getting this problem.

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket

Pages