Files
rails/activerecord/lib/active_record
Paul Sadauskas 0a75336c89 Handle nil in add_index :length option in MySQL
Our schema.rb is being generated with an `add_index` line similar to this:

    add_index "foo", ["foo", "bar"], :name => "xxx", :length => {"foo"=>8, "bar=>nil}

This is the same as it was on Rails 3.1.3, however, now when that
schema.rb is evaluated, its generating bad SQL in MySQL:

    Mysql::Error: You have an error in your SQL syntax; check the manual
    that corresponds to your MySQL server version for the right syntax
    to use near '))' at line 1: CREATE UNIQUE INDEX
    `xxx` ON `foo` (`foo`(8), `bar`())

This commit adds a check for nil on the length attribute to prevent the
empty parens from being output.

Conflicts:

	activerecord/test/cases/migration/index_test.rb

Signed-off-by: José Valim <jose.valim@gmail.com>
2012-02-08 13:34:04 +01:00
..
2012-01-13 00:42:33 +05:30
2011-12-23 12:00:37 +05:30
2012-01-10 13:24:15 -08:00
2011-12-09 01:15:54 +05:30
2012-01-26 14:54:02 -08:00