diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-07-16 10:06:55 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-07-16 10:06:55 +0200 |
commit | 3eca0621602a9f9dbc5e81f007db888d36813ed8 (patch) | |
tree | b621b02ef12656052af36f6eb265d3c8ecf858f5 /activerecord/test/cases/adapters/mysql2 | |
parent | 6f15762fa601a5e3238888038684aae7446cfc16 (diff) | |
download | rails-3eca0621602a9f9dbc5e81f007db888d36813ed8.tar.gz rails-3eca0621602a9f9dbc5e81f007db888d36813ed8.tar.bz2 rails-3eca0621602a9f9dbc5e81f007db888d36813ed8.zip |
use foreign key DSL in our tests.
Diffstat (limited to 'activerecord/test/cases/adapters/mysql2')
-rw-r--r-- | activerecord/test/cases/adapters/mysql2/schema_migrations_test.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/adapters/mysql2/schema_migrations_test.rb b/activerecord/test/cases/adapters/mysql2/schema_migrations_test.rb index ec73ec35aa..9c49599d34 100644 --- a/activerecord/test/cases/adapters/mysql2/schema_migrations_test.rb +++ b/activerecord/test/cases/adapters/mysql2/schema_migrations_test.rb @@ -6,12 +6,12 @@ module ActiveRecord class SchemaMigrationsTest < ActiveRecord::TestCase def test_renaming_index_on_foreign_key connection.add_index "engines", "car_id" - connection.execute "ALTER TABLE engines ADD CONSTRAINT fk_engines_cars FOREIGN KEY (car_id) REFERENCES cars(id)" + connection.add_foreign_key :engines, :cars, name: "fk_engines_cars" connection.rename_index("engines", "index_engines_on_car_id", "idx_renamed") assert_equal ["idx_renamed"], connection.indexes("engines").map(&:name) ensure - connection.execute "ALTER TABLE engines DROP FOREIGN KEY fk_engines_cars" + connection.remove_foreign_key :engines, name: "fk_engines_cars" end def test_initializes_schema_migrations_for_encoding_utf8mb4 |