You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the opposite behaviour of the gem, but it seems it would be useful to identify instances in which the unique constraint is defined at the database (schema) level, but not specified (eg via uniqueness: true) in the Rails model.
This could be an additional check which happens only if specified by a command-line option when executing consistency_fail, so as not to break backwards compatibility and to avoid reporting on these problems if not required. Some models may deliberately omit the validation in Rails, for instance (perhaps for performance reasons).
Does this sound like it'd be useful?
The text was updated successfully, but these errors were encountered:
Generally speaking, yes! The tricky piece is that has_one is another valid place to want a constraint, so I think I might want that to be detected too?
This is the opposite behaviour of the gem, but it seems it would be useful to identify instances in which the unique constraint is defined at the database (schema) level, but not specified (eg via
uniqueness: true
) in the Rails model.This could be an additional check which happens only if specified by a command-line option when executing
consistency_fail
, so as not to break backwards compatibility and to avoid reporting on these problems if not required. Some models may deliberately omit the validation in Rails, for instance (perhaps for performance reasons).Does this sound like it'd be useful?
The text was updated successfully, but these errors were encountered: