Start here. This is the direct spoken answer to practice first.
Overview
A migration must work with the model shape at that point in history, not whatever the application model becomes later.
Django stores model state in migration files so it can reconstruct the schema at each migration step. Code in RunPython should obtain models through the migration app registry, usually with apps.get_model(), rather than importing the current model class. A direct import may work today but fail when a fresh database replays the migration after the model has changed.