Detect schema inconsistencies
In context of Rails database migrations, we have to keep db/schema.rb
(or later db/structure.sql
) in sync and consistent with whatever schema changes a migration adds. It is important to make sure the schema file is consistent with any migrations being added, otherwise existing systems and their database schema deviates from newly created ones.
In order to detect inconsistencies, we want to add a job to CI that surfaces this problem.
For starters and for testing, this can be added without failing the pipeline. Once we're confident about this check, we'd make it fail the pipeline.