rails/rails — Issue #3440: Generated schema ignores id: false on mysql2
Author: rmehner
Created: 2011-10-26 15:20:35+00:00
State: open

Hi there,

using Rails 3.1.1 (on 1.9.2), when I have the following migration

```ruby
class CreateCodes < ActiveRecord::Migration
def change
create_table :codes, id: false do |t|
t.string :key, null: false
end

add_index :codes, :key, unique: true
end
end
```

I would expect the following schema

```ruby
create_table "codes", :id => false, :force => true do |t|
t.string "key", :null => false
end

add_index "codes", ["key"], :name => "index_codes_on_key", :unique => true
```

but what I really get is:

```ruby
create_table "codes", :primary_key => "key", :force => true do |t|
end

add_index "codes", ["key"], :name => "index_codes_on_key", :unique => true
```

Note that this does not happen using sqlite3, but when using mysql2 (0.3.7) and mysql (2.8.1)

I really don't know if this is a Rails bug or more on the mysql driver side so I'm happy to take some pointers.

If there is any information missing please let me know

Thank you in advance for looking into it,
- Robin