This project is archived and is in readonly mode.

#4101 ✓ stale
Jarl Friis

ActiveRecord::ConnectionAdapters::Table#index does not generat indexes

Reported by Jarl Friis | March 3rd, 2010 @ 08:50 PM

Hi.

When using the following syntax for creating indexes in a migration, no indexes are created:

create_table :properties do |t|
  t.string :namespace
  t.string :name
  t.string :value

  t.index [:namespace, :name], :unique => true
end

However when I use

create_table :properties do |t|
  t.string :namespace
  t.string :name
  t.string :value
end
add_index :properties, [:namespace, :name], :unique => true

Things work fine.

This has been reproduced on both PostgreSQL and MySQL adapter. Please
see
http://groups.google.com/group/rubyonrails-talk/msg/e5b9a1fad6ccf79c
for the discussion and confirmation.

Jarl

Comments and changes to this ticket

Tickets have moved to Github

The new ticket tracker is available at https://github.com/rails/rails/issues

Shared Ticket Bins

People watching this ticket

Pages