1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix a bug with initialize schema_migrations table

This line causes an error when executing the command: `rails db:drop db:create db:schema:load`

ActiveRecord::StatementInvalid: PG::SyntaxError: ERROR:  syntax error at or near "{"
LINE 1: ...NSERT INTO "schema_migrations" (version) VALUES (#{v}), (#{v...
This commit is contained in:
Mikhail Grachev 2016-01-28 12:09:27 +03:00
parent 1ac3fb9f06
commit e0026e2327

View file

@ -992,7 +992,7 @@ module ActiveRecord
if (duplicate = inserting.detect {|v| inserting.count(v) > 1}) if (duplicate = inserting.detect {|v| inserting.count(v) > 1})
raise "Duplicate migration #{duplicate}. Please renumber your migrations to resolve the conflict." raise "Duplicate migration #{duplicate}. Please renumber your migrations to resolve the conflict."
end end
execute "INSERT INTO #{sm_table} (version) VALUES #{inserting.map {|v| '(#{v})'}.join(', ') }" execute "INSERT INTO #{sm_table} (version) VALUES #{inserting.map {|v| "('#{v}')"}.join(', ') }"
end end
end end