﻿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
37031	Improve writing migrations guide to adding unique fields on existing table	Clifford Gama	Clifford Gama	"1. The current approach splits the work across three files: one to add the field, one to populate values, and one to restore the constraint. All three operations can be placed in a single migration, which is simpler to follow and has the added benefit of being atomic — removing the race condition that is currently warned about in the docs.

2. I think the section should mention that `Field.db_default` avoids this problem entirely by having the database generate a unique value per row. This is worth noting upfront so readers can choose the simpler path where their use case allows.

3. No mention of performant alternatives for large tables: The `RunPython` example iterates row by row with individual saves. For large tables this will be very slow. The docs should note that `QuerySet.bulk_update()` or RunSQL are worth considering in that case."	Cleanup/optimization	assigned	Documentation	dev	Normal		migrations	MANAS MADESHIYA Shai Berger Markus Holtermann	Unreviewed	0	0	0	0	0	0
