diff options
Diffstat (limited to 'activerecord/test/cases/migration/change_table_test.rb')
-rw-r--r-- | activerecord/test/cases/migration/change_table_test.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/activerecord/test/cases/migration/change_table_test.rb b/activerecord/test/cases/migration/change_table_test.rb index 87da9c90fe..8a4242cf1d 100644 --- a/activerecord/test/cases/migration/change_table_test.rb +++ b/activerecord/test/cases/migration/change_table_test.rb @@ -101,7 +101,12 @@ module ActiveRecord def test_primary_key_creates_primary_key_column with_change_table do |t| - @connection.expect :add_column, nil, [:delete_me, :id, :primary_key, primary_key: true, first: true] + if current_adapter?(:Mysql2Adapter) + @connection.expect :add_column, nil, [:delete_me, :id, :primary_key, { first: true, auto_increment: true, limit: 8, primary_key: true }] + else + @connection.expect :add_column, nil, [:delete_me, :id, :primary_key, primary_key: true, first: true] + end + t.primary_key :id, first: true end end @@ -157,7 +162,7 @@ module ActiveRecord def test_column_creates_column_with_options with_change_table do |t| - @connection.expect :add_column, nil, [:delete_me, :bar, :integer, {null: false}] + @connection.expect :add_column, nil, [:delete_me, :bar, :integer, { null: false }] t.column :bar, :integer, null: false end end @@ -171,7 +176,7 @@ module ActiveRecord def test_index_creates_index_with_options with_change_table do |t| - @connection.expect :add_index, nil, [:delete_me, :bar, {unique: true}] + @connection.expect :add_index, nil, [:delete_me, :bar, { unique: true }] t.index :bar, unique: true end end @@ -185,7 +190,7 @@ module ActiveRecord def test_index_exists_with_options with_change_table do |t| - @connection.expect :index_exists?, nil, [:delete_me, :bar, {unique: true}] + @connection.expect :index_exists?, nil, [:delete_me, :bar, { unique: true }] t.index_exists?(:bar, unique: true) end end @@ -206,7 +211,7 @@ module ActiveRecord def test_change_changes_column_with_options with_change_table do |t| - @connection.expect :change_column, nil, [:delete_me, :bar, :string, {null: true}] + @connection.expect :change_column, nil, [:delete_me, :bar, :string, { null: true }] t.change :bar, :string, null: true end end @@ -234,7 +239,7 @@ module ActiveRecord def test_remove_index_removes_index_with_options with_change_table do |t| - @connection.expect :remove_index, nil, [:delete_me, {unique: true}] + @connection.expect :remove_index, nil, [:delete_me, { unique: true }] t.remove_index unique: true end end |