1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

10 commits

Author SHA1 Message Date
Rafael Mendonça França
6614471173 Fix warning 2013-02-21 00:51:39 -03:00
Yves Senn
cca43528d4 reserve index name chars for internal rails operations
Some adapter (SQLite3) need to perform renaming operations to support
the rails DDL. These rename prefixes operate with prefixes. When an
index name already uses up the full space provieded by
`index_name_length` these internal operations will fail. This patch
introduces `allowed_index_name_length` which respects the amount of
characters used for internal operations. It will always be <=
`index_name_length` and every adapter can define how many characters
need to be reserved.
2013-02-20 17:50:10 +01:00
Rafael Mendonça França
5294ad82c6 Alias refute methods to assert_not and perfer assert_not on tests 2012-12-31 13:58:52 -03:00
Rafael Mendonça França
7042fe2f84 Deprecate passing a string as third argument of add_index
This was there due historical reasons since
7dc45818dc to give the user the
possibility to create unique indexes passing "UNIQUE" as the third
argument
2012-11-02 20:03:26 -02:00
Rafael Mendonça França
8fc52706c3 Raise an ArgumentError when passing an invalid option to add_index
Closes #8104
2012-11-02 19:00:58 -02:00
Marcelo Silveira
aaffc2acd5 improved test case for partial indices 2012-02-09 19:04:07 -02:00
Marcelo Silveira
7ef22fce7c Made schema dumper recognize partial indices' where statements 2012-02-09 03:28:11 -02:00
Paul Sadauskas
6cde635f34 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.
2012-01-24 14:22:24 -07:00
Aaron Patterson
706d8ea11a move another index related test case 2012-01-13 14:33:55 -08:00
Aaron Patterson
a394985447 move tests regarding index modification to their own class 2012-01-13 14:33:55 -08:00