This PR adds the [database_consistency 
gem](https://github.com/djezzzl/database_consistency/), which compares our 
database structure and model definitions to ensure they are both consistent.

For example, we have many model attributes which are required by the database, 
but don't have any corresponding presence checkers in the model. Or things 
like table ids or user references being defined as `integer` instead of 
`bigint` (which I missed when I created issues and reports, for example! Oops).

Having this gem will help guide contributors, when they are adding new tables 
to the database. I appreciate hasn't happened very frequently in the past. 
I've used this gem for many years on my own projects.

As usual with linting tools, I've set this up to have a TODO list which 
suppresses existing issues. This means that we can work on these in the 
background, while preventing any new issues in new work. I've also set it 
up to run in CI. I've not yet added it to either the documentation or to 
the overcommit configuration, mostly because it's so rare that anyone is 
making any relevant changes.



You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/6821

-- Commit Summary --

  * Add database_consistency gem

-- File Changes --

    A .database_consistency.yml (497)
    M .github/workflows/lint.yml (15)
    M Gemfile (1)
    M Gemfile.lock (3)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/6821.patch
https://github.com/openstreetmap/openstreetmap-website/pull/6821.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6821
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to