﻿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
35957	Allow AutoFields in composite primary keys	Csirmaz Bendegúz	David Sanders	"This is a follow up to #373 (''CompositePrimaryKey''), #8576 (''Multiple AutoFields in a model''), #27452 (''SerialField'').

At the moment, `AutoField`s must set `primary_key=True`.

This makes it impossible to use them with `CompositePrimaryKey`.

''Multiple AutoFields in a model'' (#8576) may not be useful, but having an `AutoField` be part of a composite primary key has its uses. It's good practice to use surrogate keys, even if the table has a composite primary key (should this surrogate key be an auto-incremented field is another discussion).

So I think we should allow `AutoField`s to not set `primary_key=True` if they are part of a composite primary key.

Note: SQLite doesn't support AutoFields in composite primary keys.
"	New feature	assigned	Database layer (models, ORM)	dev	Normal			Simon Charette Lily Foote	Accepted	1	0	0	1	0	0
