Sqlite adapter's copy_table incorrectly attempts to recreate a primary key id (:id => true in the create_table) if an :id column is present, even if it isn't a primary_key.

This fix sets :id => false if there is an :id column, but it's not the primary_key.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1766 state:committed]
This commit is contained in:
Jacob Dunphy
2009-01-15 13:30:44 -08:00
committed by Michael Koziarski
parent feed7b4cfd
commit e6493eb9b7
3 changed files with 17 additions and 1 deletions

View File

@@ -154,6 +154,11 @@ ActiveRecord::Schema.define do
t.string :name
end
create_table :goofy_string_id, :force => true, :id => false do |t|
t.string :id, :null => false
t.string :info
end
create_table :items, :force => true do |t|
t.column :name, :integer
end