rails/activerecord/test/cases/migration
Prathamesh Sonpatki 7ba08037f8
Add support for if_not_exists to indexes
When we try to create a table which already exists which also adds
indexes, then the `if_not_exists` option passed to `create_table` is
not extended to indexes. So the migration results into an error if the
table and indexes already exist.
This change extends the `if_not_exists` support to `add_index` so that
if the migration tries to create a table which also has existing
indexes, error won't be raised.
Also as a side-effect individual `add_index` calls will also accept
`if_not_exists` option and respect it henceforth.

[Prathamesh Sonpatki, Justin George]
2020-03-29 10:30:01 -04:00
..
change_schema_test.rb Fix CI failures due to MySQL 8.0.19 no longer output integer display width unless ZEROFILL is also used 2020-01-15 21:40:10 +09:00
change_table_test.rb *_for_alter methods should also takes keyword arguments 2020-01-20 09:15:29 +09:00
column_attributes_test.rb Raise ArgumentError for invalid :limit and :precision like as other options 2019-04-07 16:14:42 +09:00
column_positioning_test.rb add_reference should respect column position for both reference id and type columns 2017-09-01 21:49:28 +09:00
columns_test.rb Cache database version in schema cache 2019-04-03 11:10:14 -04:00
command_recorder_test.rb Fix CI failure on Ruby master 2020-01-29 09:22:25 +09:00
compatibility_test.rb Move SchemaMigration to migration_context 2019-06-14 11:15:08 -04:00
create_join_table_test.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
foreign_key_test.rb Fix foreign_key_exists? in change_table to allow keyword arguments 2020-02-05 09:03:15 +09:00
helper.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
index_test.rb Add support for if_not_exists to indexes 2020-03-29 10:30:01 -04:00
logger_test.rb Move SchemaMigration to migration_context 2019-06-14 11:15:08 -04:00
pending_migrations_test.rb Use FileUpdateChecker for Migration::CheckPending 2019-10-08 16:29:12 -07:00
references_foreign_key_test.rb Remove NoForeignKeySupportTest which is no longer reached 2019-02-16 15:13:00 +09:00
references_index_test.rb Use frozen-string-literal in ActiveRecord 2017-07-19 22:27:07 +03:00
references_statements_test.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
rename_table_test.rb Remove usage of strip_heredoc in the framework in favor of <<~ 2018-02-16 19:28:30 -05:00