mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Update supports_rename_index?
version for MariaDB
Looks like the CI failure is caused by rename index on a foreign key constraint. https://buildkite.com/rails/rails/builds/69099#1b008fd1-1d2f-4c87-934a-8cdfd6e42c67/1022-2096
This commit is contained in:
parent
e887fd9a02
commit
b1ac0f5521
2 changed files with 9 additions and 1 deletions
|
@ -694,7 +694,11 @@ module ActiveRecord
|
|||
end
|
||||
|
||||
def supports_rename_index?
|
||||
mariadb? ? false : database_version >= "5.7.6"
|
||||
if mariadb?
|
||||
database_version >= "10.5.2"
|
||||
else
|
||||
database_version >= "5.7.6"
|
||||
end
|
||||
end
|
||||
|
||||
def configure_connection
|
||||
|
|
|
@ -93,6 +93,10 @@ if ActiveRecord::Base.connection.supports_foreign_keys?
|
|||
end
|
||||
|
||||
def test_rename_reference_column_of_child_table
|
||||
if current_adapter?(:Mysql2Adapter) && !@connection.send(:supports_rename_index?)
|
||||
skip "Cannot drop index, needed in a foreign key constraint"
|
||||
end
|
||||
|
||||
rocket = Rocket.create!(name: "myrocket")
|
||||
rocket.astronauts << Astronaut.create!
|
||||
|
||||
|
|
Loading…
Reference in a new issue