Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync test DB from schema using its SHA1
Previously, we used the migration status to determine whether the test database(s) needed to be reloaded from the schema. This worked in most cases, but if a schema.rb was modified outside of migrations or if a migration was rolled back, it would require a manual db:test:prepare. This commit updates load_schema to record the SHA1 of the loaded schema file inside of the ar_internal_metadata table. We can then use this SHA to determine whether we should reload the schema. This ensures that the test DB stays exactly in sync with the schema file, including rollbacks which fixes a test marked TODO.
- Loading branch information
Showing
3 changed files
with
25 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters