Skip to content

Remove checks for specific database schema version

Andreas Brandl requested to merge ab/cleanup-schema-checks into master

What does this MR do?

In a couple of places, we have code paths that depend on a specific schema version:

if ActiveRecord::Migrator.current_version >= MINIMUM_SCHEMA_VERSION
  # do something
else
  # don't do it
end

AFAIK we introduced this only for testing purposes. Consider for example a model callback which requires a certain table only introduced by version x. In specs, we assume schema y < x (a migration spec perhaps?). This is still triggering the callback, which fails because the table is not present in y.

With !31936 (merged), we've squashed migrations introduced before 2019 and removed corresponding migration specs.

This means we should be able to remove these schema version checks from the codebase now and this is what the change at hand does.

Relates to #28249 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading