aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorAbdelkader Boudih <terminale@gmail.com>2014-06-27 08:46:07 +0000
committerAbdelkader Boudih <terminale@gmail.com>2014-06-27 19:43:54 +0000
commitb58ec66f0e96ef7741d9ae7ae619683e6cb9d1f8 (patch)
treee7798d3c07957d60e7be4b7d2cbb88870d981a8a /activerecord/test/cases
parent30b56084fb67d99fa3284d34c9bb914ebee378b6 (diff)
downloadrails-b58ec66f0e96ef7741d9ae7ae619683e6cb9d1f8.tar.gz
rails-b58ec66f0e96ef7741d9ae7ae619683e6cb9d1f8.tar.bz2
rails-b58ec66f0e96ef7741d9ae7ae619683e6cb9d1f8.zip
rename sequence only if it exists
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/migration/rename_table_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration/rename_table_test.rb b/activerecord/test/cases/migration/rename_table_test.rb
index a52b58c4ac..ba39fb1dec 100644
--- a/activerecord/test/cases/migration/rename_table_test.rb
+++ b/activerecord/test/cases/migration/rename_table_test.rb
@@ -76,6 +76,16 @@ module ActiveRecord
assert_equal ConnectionAdapters::PostgreSQL::Name.new("public", "octopi_#{pk}_seq"), seq
end
+
+ def test_renaming_table_doesnt_attempt_to_rename_non_existent_sequences
+ enable_uuid_ossp!(connection)
+ connection.create_table :cats, id: :uuid
+ assert_nothing_raised { rename_table :cats, :felines }
+ assert connection.table_exists? :felines
+ ensure
+ connection.drop_table :cats if connection.table_exists? :cats
+ connection.drop_table :felines if connection.table_exists? :felines
+ end
end
end
end