diff options
author | Vipul A M <vipulnsward@gmail.com> | 2013-03-26 02:00:53 +0530 |
---|---|---|
committer | Vipul A M <vipulnsward@gmail.com> | 2013-03-27 00:15:59 +0530 |
commit | 437961b558363df0f489fe976f89258c442dcb05 (patch) | |
tree | 213b866529c85217909bad774cc1288c70dca10f /activerecord/test/cases/migration | |
parent | 1a838ccda4a31bb023985f6c977e6bc3e238cda9 (diff) | |
download | rails-437961b558363df0f489fe976f89258c442dcb05.tar.gz rails-437961b558363df0f489fe976f89258c442dcb05.tar.bz2 rails-437961b558363df0f489fe976f89258c442dcb05.zip |
respect auto_increment in rename_column for mysql
Diffstat (limited to 'activerecord/test/cases/migration')
-rw-r--r-- | activerecord/test/cases/migration/columns_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration/columns_test.rb b/activerecord/test/cases/migration/columns_test.rb index e52809f0f8..52906c8a01 100644 --- a/activerecord/test/cases/migration/columns_test.rb +++ b/activerecord/test/cases/migration/columns_test.rb @@ -62,6 +62,13 @@ module ActiveRecord assert_equal 70000, default_after end + if current_adapter?(:MysqlAdapter, :Mysql2Adapter) + def test_mysql_rename_column_preserves_auto_increment + rename_column "test_models", "id", "id_test" + assert_equal "auto_increment", connection.columns("test_models").find { |c| c.name == "id_test" }.extra + end + end + def test_rename_nonexistent_column exception = if current_adapter?(:PostgreSQLAdapter, :OracleAdapter) ActiveRecord::StatementInvalid |