aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration/index_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Remove deprecated argument `default` from `index_name_exists?`Rafael Mendonça França2017-10-231-4/+2
|
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Deprecate passing `default` to `index_name_exists?`Ryuta Kamizono2017-02-131-2/+4
|
* The `default` arg of `index_name_exists?` makes to optionalRyuta Kamizono2017-02-131-8/+6
| | | | | | The `default` arg of `index_name_exists?` is only used the adapter does not implemented `indexes`. But currently all adapters implemented `indexes` (See #26688). Therefore the `default` arg is never used.
* Add three new rubocop rulesRafael Mendonça França2016-08-161-6/+6
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* Add `Style/EmptyLines` in `.rubocop.yml` and remove extra empty linesRyuta Kamizono2016-08-071-1/+0
|
* applies remaining conventions across the projectXavier Noria2016-08-061-1/+0
|
* modernizes hash syntax in activerecordXavier Noria2016-08-061-35/+35
|
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-14/+14
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Merge pull request #19456 from greysteil/index-exists-behaviourMatthew Draper2015-12-181-0/+10
|\ | | | | | | Ignore index name in `index_exists?` when not passed a name to check for
| * Support removing custom-names indexes when only specifying column namesGrey Baker2015-12-151-0/+8
| |
| * Ignore index name in `index_exists?` when not passed a name to check forGrey Baker2015-12-151-0/+2
| |
* | Remove legacy mysql adapterAbdelkader Boudih2015-12-171-1/+1
|/
* raise a better exception for renaming long indexesAaron Patterson2014-11-201-0/+14
|
* `index_exists?` with `:name` checks specified columns.Yves Senn2014-08-131-0/+6
| | | | | | | | | | | | | | | [Yves Senn & Matthew Draper] The column check was embodied in the defaul index name. If the :name option was used, the specified columns were not verified at all. Given: ``` assert connection.index_exists?(table_name, :foo_id, :name => :index_testings_on_yo_momma) ``` That index could have been defined on any field, not necessarily on `:foo_id`.
* Remove dead test code for unsupported adaptersSean Griffin2014-05-171-55/+39
|
* Use teardown helper method.Guo Xiang Tan2014-03-141-2/+1
| | | | | | | | Follow-Up to https://github.com/rails/rails/pull/14348 Ensure that SQLCounter.clear_log is called after each test. This is a step to prevent side effects when running tests. This will allow us to run them in random order.
* Remove more skipRafael Mendonça França2013-11-081-7/+7
|
* Don't skip tests if we don't need to.Rafael Mendonça França2013-11-081-23/+19
| | | | | | | We can conditional define the tests depending on the adapter or connection. Lets keep the skip for fail tests that need to be fixed.
* Remove behavior that deals with a string as third argument of `add_index`, ↵kennyj2013-06-021-10/+0
| | | | | | because this was deprecated. Some testcases is failed, so I replaced nil to empty hash in add_reference.
* Fix warningRafael Mendonça França2013-02-211-1/+1
|
* reserve index name chars for internal rails operationsYves Senn2013-02-201-5/+23
| | | | | | | | | | | 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.
* Alias refute methods to assert_not and perfer assert_not on testsRafael Mendonça França2012-12-311-3/+3
|
* Deprecate passing a string as third argument of `add_index`Rafael Mendonça França2012-11-021-0/+10
| | | | | | | This was there due historical reasons since 7dc45818dc43c163700efc9896a0f3feafa31138 to give the user the possibility to create unique indexes passing "UNIQUE" as the third argument
* Raise an ArgumentError when passing an invalid option to add_indexRafael Mendonça França2012-11-021-0/+6
| | | | Closes #8104
* improved test case for partial indicesMarcelo Silveira2012-02-091-6/+9
|
* Made schema dumper recognize partial indices' where statementsMarcelo Silveira2012-02-091-0/+6
|
* Handle nil in add_index :length option in MySQLPaul Sadauskas2012-01-241-1/+7
| | | | | | | | | | | | | | | | | 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.
* move another index related test caseAaron Patterson2012-01-131-0/+68
|
* move tests regarding index modification to their own classAaron Patterson2012-01-131-0/+102