﻿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
29720	Validating migrations using manage.py	Thomas Basche	nobody	"At work we have several Django services each with several apps. Usually after a few devs merge pull requests into the main branch in Git we get migrations with the same number. From time to time there's also some reordering with dependencies in migrations leap-frogging the previous one.

This obviously gets picked up at run time, but it would be cool to be able to determine this at build time. Obviously we should all take more care, but I would consider this more of a ""linting"" stage than anything else.

In the interim I wrote (or rather, hacked together) a cli tool that validates this, but ultimately this would be better suited as a manage.py command. Something like {{{manage.py validate-migrations }}}. All it has to do is check the migration numbers are incremental and that their dependencies refer to the previous migration in the list. 

"	New feature	closed	Migrations	2.1	Normal	invalid	migrations, manage.py, validation		Unreviewed	0	0	0	0	0	0
