djezzzl / database_consistency

The tool to avoid various issues due to inconsistencies and inefficiencies between a database schema and application models.
MIT License
1.02k stars 43 forks source link

Error when running ForeignKeyCascadeChecker #217

Open gravitystorm opened 8 months ago

gravitystorm commented 8 months ago

During the first run of database_checker on our codebase, it reported an error and asked for it to be filed here. It might just be an unusual problem in our codebase, so I don't mind if this is closed wontfix!

Metadata:
model: Trace
association: points
checker: DatabaseConsistency::Checkers::ForeignKeyCascadeChecker
Stack trace:
/home/andy/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/activerecord-7.1.1/lib/active_record/reflection.rb:345:in `primary_key': Unknown primary key for table gps_points in model Tracepoint. (ActiveRecord::UnknownPrimaryKey)

Full stacktrace attached. The application is the OpenStreetMap-website codebase, if you'd like to reproduce it or see how our models are defined.

gravitystorm commented 8 months ago

database_consistency_2023_10_25_15_46_43.txt