Skip to content

Freeze migration helpers: keep migration 0002_geo self-contained #8160

@coderabbitai

Description

@coderabbitai

Summary

Migration 0002_geo.py (initial = True) currently imports create_default_collection_types from the runtime module specifyweb/specify/utils.py and calls it via handle_default_collection_types(apps). Because runtime helpers can change over time, future modifications to specifyweb/specify/utils.py (e.g., to create_default_collection_types, BusinessRuleException usage, or logging) could silently alter or break this already-shipped migration on fresh installs.

Desired outcome

As part of the broader effort to modularize and freeze migration code:

  • Inline the relevant logic directly inside 0002_geo.py, or
  • Move it into a dedicated frozen migration-only helper module (alongside the migrations package) that is never modified after being shipped.
  • Ensure the migration does not reference any live runtime symbols (e.g., BusinessRuleException, logger) from specifyweb/specify/utils.

Context

/cc @CarolineDenis

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions