aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorJ. Pablo Fernández <pupeno@pupeno.com>2010-06-12 03:25:18 +0200
committerJosé Valim <jose.valim@gmail.com>2010-06-29 21:17:07 +0200
commitff22b9d451efc4251c28d11453f05fed95378af4 (patch)
tree3181e60940bba36809be160d5ffafac806a4e1e4 /activerecord/test/cases
parentaf6ec607fa9af96569fd2e143147f2dc0ecd583b (diff)
downloadrails-ff22b9d451efc4251c28d11453f05fed95378af4.tar.gz
rails-ff22b9d451efc4251c28d11453f05fed95378af4.tar.bz2
rails-ff22b9d451efc4251c28d11453f05fed95378af4.zip
Fixed error when removing an index from a table name values, which is a reserved word, with test.
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/migration_test.rb16
1 files changed, 16 insertions, 0 deletions
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