We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0bded31 + 7ef2c20 commit d8a3011Copy full SHA for d8a3011
guides/source/configuring.md
@@ -1212,12 +1212,16 @@ to change the default behavior:
1212
1213
```ruby
1214
class CustomSchemaVersionsFormatter
1215
+ def initialize(connection)
1216
+ @connection = connection
1217
+ end
1218
+
1219
def format(versions)
1220
# Special sorting of versions to reduce the likelihood of conflicts.
1221
sorted_versions = versions.sort { |a, b| b.to_s.reverse <=> a.to_s.reverse }
1222
1223
sql = +"INSERT INTO schema_migrations (version) VALUES\n"
- sql << sorted_versions.map { |v| "(#{connection.quote(v)})" }.join(",\n")
1224
+ sql << sorted_versions.map { |v| "(#{@connection.quote(v)})" }.join(",\n")
1225
sql << ";"
1226
sql
1227
end
0 commit comments