This project is archived and is in readonly mode.

#2879 ✓duplicate
Francesc Esplugas

auto_increment on create_table option is not included on schema.rb

Reported by Francesc Esplugas | July 7th, 2009 @ 01:14 PM | in 2.x

For some reason I have to use on a migration an special primary key.

create_table :articles, :primary_key => :my_special_id do |t|
  t.integer :my_special_id
  t.string :title
end

The schema.rb generated is not what I expect because the primary_key is not included.

create_table "articles", :id => false, :force => true do |t|
  t.integer "my_special_id", :null => false
  t.string "title"
end

This will make the application break if we run rake db:schema:load, the recomended way to generate an initial database, instead of the rake db:migrate.

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>

Tags

Pages