diff options
author | Yves Senn <yves.senn@gmail.com> | 2012-12-15 22:42:22 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@garaio.com> | 2012-12-19 12:24:35 +0100 |
commit | 9f69d42860a56c585271484f49445f1b43dac357 (patch) | |
tree | 6ad4736a3358305efff45b821e5afa965bb9d546 /activerecord/test/cases | |
parent | df048b574b5ab5a449a3b1dfc50dbf3baa18869e (diff) | |
download | rails-9f69d42860a56c585271484f49445f1b43dac357.tar.gz rails-9f69d42860a56c585271484f49445f1b43dac357.tar.bz2 rails-9f69d42860a56c585271484f49445f1b43dac357.zip |
Backport #8522, Keep index names when using with sqlite3
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
activerecord/test/cases/migration/rename_column_test.rb
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index ff633f7f0f..7bb71b7b6e 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -1051,6 +1051,18 @@ if ActiveRecord::Base.connection.supports_migrations? Person.connection.remove_column("people", "administrator") rescue nil end + def test_change_column_with_custom_index_name + Person.connection.add_column "people", "category", :string, :default => 'human' + Person.connection.add_index :people, :category, :name => 'people_categories_idx' + + assert_equal ['people_categories_idx'], Person.connection.indexes('people').map(&:name) + Person.connection.change_column "people", "category", :string, :null => false, :default => 'article' + + assert_equal ['people_categories_idx'], Person.connection.indexes('people').map(&:name) + ensure + Person.connection.remove_column("people", "category") rescue nil + end + def test_change_column_default Person.connection.change_column_default "people", "first_name", "Tester" Person.reset_column_information |