From ff22b9d451efc4251c28d11453f05fed95378af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Pablo=20Fern=C3=A1ndez?= Date: Sat, 12 Jun 2010 03:25:18 +0200 Subject: Fixed error when removing an index from a table name values, which is a reserved word, with test. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- activerecord/test/cases/migration_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index 99a3a12a8b..a46d8b18a4 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -1621,6 +1621,22 @@ if ActiveRecord::Base.connection.supports_migrations? end end + class ReservedWordsMigrationTest < ActiveRecord::TestCase + def test_drop_index_from_table_named_values + connection = Person.connection + connection.create_table :values, :force => true do |t| + t.integer :value + end + connection.add_index :values, :value + + # Just remove the index, it should not raise an exception + connection.remove_index :values, :column => :value + + connection.drop_table :values rescue nil + end + end + + class ChangeTableMigrationsTest < ActiveRecord::TestCase def setup @connection = Person.connection -- cgit v1.2.3