﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
34790	loading old migration file	Amin Aminian	nobody	"Hi!

I was working on my Django command, which is a command for setting migrations zero (link: [https://github.com/aminiun/django-zeromigrations]).

In this command, the migration files are deleted and new migration files are going to be generated.

The problem is, after new migrations are generated, I am trying to call `migrate --fake` command, and during the process of loading migrations and building graph, I found out that the old migration of some apps are loaded, instead of new one.

After tracing the process, I found out this is because of `sys.modules`. As the old migration files are loaded in `sys.modules` already.

In the `db/migrations/loader` module, I saw that we are reloading the `<app>/migrations`:


{{{
# Force a reload if it's already loaded (tests need this)
if was_loaded:
    reload(module)
}}}


But we are not reloading migration files modules, like `<app>/migrations/0001_initial.py`, which was causing me error.

So I suggest to have reload for migration files too, to prevent any issues ..."	New feature	closed	Migrations	4.2	Normal	wontfix			Unreviewed	0	0	0	0	0	0
