Revert "Revert "Merge pull request #15394 from morgoth/fix-automatic-maintaining-test-schema-for-sql-format""

This reverts commit 5c87b5c5248154cf8aa76cce9a24a88769de022d.
schema rake tasks are specific about the configuration to act on.

The rake tasks and the `DatabaseTakss` adapter classes used to
assume a configuration at some places. This forced the rake
tasks to establish a specific connection before calling into
`load_schema`.

After #15394 this started to cause issues because it could
`purge` the wrong database before loading the schema.
Merge pull request #16316 from rails/senny/purge_schema_maintenance

purge database before loading schema, take 2