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

Make sure clone_structure can load the results of dump_schema_information

SchemaStatements#dump_schema_information joins inserts with a single \n, but is later split on \n\n, and fails when trying to execute all the inserts as a single sql statement.

Signed-off-by: Michael Koziarski <michael@koziarski.com>

[#201 state:resolved]
This commit is contained in:
Steven Soroka 2008-05-16 17:41:59 -05:00 committed by Michael Koziarski
parent 72ed17df44
commit 2183c220ad

View file

@ -302,7 +302,7 @@ module ActiveRecord
def dump_schema_information #:nodoc:
sm_table = ActiveRecord::Migrator.schema_migrations_table_name
migrated = select_values("SELECT version FROM #{sm_table}")
migrated.map { |v| "INSERT INTO #{sm_table} (version) VALUES ('#{v}');" }.join("\n")
migrated.map { |v| "INSERT INTO #{sm_table} (version) VALUES ('#{v}');" }.join("\n\n")
end
# Should not be called normally, but this operation is non-destructive.