diff options
author | Jamis Buck <jamis@37signals.com> | 2005-10-25 19:28:53 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-10-25 19:28:53 +0000 |
commit | 06303ed34eea1f9c3dfa8c7d0ada186b0faf648f (patch) | |
tree | dbc5e6a4916e018d118e9607b0b6b71a63d10e4c /activerecord/test | |
parent | 17d3fd316551660ad19251b969540dc304a9a48c (diff) | |
download | rails-06303ed34eea1f9c3dfa8c7d0ada186b0faf648f.tar.gz rails-06303ed34eea1f9c3dfa8c7d0ada186b0faf648f.tar.bz2 rails-06303ed34eea1f9c3dfa8c7d0ada186b0faf648f.zip |
Allow symbols to rename columns when using SQLite adapter. #2531 [kevin.clark@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2731 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/migration_test.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/activerecord/test/migration_test.rb b/activerecord/test/migration_test.rb index 702fef7436..4d10767991 100644 --- a/activerecord/test/migration_test.rb +++ b/activerecord/test/migration_test.rb @@ -180,6 +180,28 @@ if ActiveRecord::Base.connection.supports_migrations? end + def test_rename_column_using_symbol_arguments + begin + Person.connection.rename_column :people, :first_name, :nick_name + Person.reset_column_information + assert Person.column_names.include?("nick_name") + ensure + Person.connection.remove_column("people","nick_name") + Person.connection.add_column("people","first_name", :string) + end + end + + def test_rename_column + begin + Person.connection.rename_column "people", "first_name", "nick_name" + Person.reset_column_information + assert Person.column_names.include?("nick_name") + ensure + Person.connection.remove_column("people","nick_name") + Person.connection.add_column("people","first_name", :string) + end + end + def test_rename_table begin ActiveRecord::Base.connection.create_table :octopuses do |t| |