mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
thanks to @jurriaan
This commit is contained in:
parent
bbef7b012f
commit
602e038ac5
1 changed files with 1 additions and 1 deletions
|
@ -505,7 +505,7 @@ module ActiveRecord
|
|||
execute_and_free("SHOW CREATE TABLE #{quote_table_name(table)}", 'SCHEMA') do |result|
|
||||
create_table = each_hash(result).first[:"Create Table"]
|
||||
if create_table.to_s =~ /PRIMARY KEY\s+\((.+)\)/
|
||||
keys = $1.split(",").map { |key| key.tr('`"', "") }
|
||||
keys = $1.split(",").map { |key| key.delete('`"') }
|
||||
keys.length == 1 ? [keys.first, nil] : nil
|
||||
else
|
||||
nil
|
||||
|
|
Loading…
Reference in a new issue