This project is archived and is in readonly mode.

#1908 ✓committed
Tristan Dunn

Schema dumper ignores custom id column even when :id => false

Reported by Tristan Dunn | February 7th, 2009 @ 11:42 PM | in 2.3.4

Given the following migration:


create_table(:table, :id => false) do |t|
  t.string :id, :null => false, :limit => 40
end

the schema dumper would generate the following:


create_table "table", :force => true do |t|
end

This is due to it automatically assuming the ID is the primary key. I got around this problem by checking if the column is also an integer. Not sure if it's the best way, but it just drove me crazy for a good while since my tests would fail, but everything worked fine in the console. I have attached my simple patch.

Comments and changes to this ticket

Create your profile

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

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages