﻿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
24442	Index name truncation is odd	Shai Berger	Akshesh Doshi	"The code that generates index names for migrations (https://github.com/django/django/blob/8ca35d7c6a639933927f45b439363a1614da56f1/django/db/backends/base/schema.py#L789) behaves in undesired ways when the name it has created turns out to be too long. It starts by cutting out parts of the table name (with no compensation hash), which could lead to name-uniqueness violations; and in case this wasn't enough, just gives up on meaningful naming and replaces the whole name with a digest.

We should do better. Here's one suggestion: divide the available name length into 3 equal parts -- one for the table name, one for the first column name, and one for the uniqueness-digest and suffix. Make each part fit its size by the normal truncation method, replacing its end with a 4-hexdigit hash if necessary.

I'm tempted to mark this a blocker -- so that we don't end up with incorrectly named indexes in the wild."	Bug	closed	Migrations	dev	Normal	fixed	oracle	Markus Holtermann	Accepted	1	0	0	0	0	0
