#30060 closed Cleanup/optimization (fixed)
Improve extensibility of schema migration for custom backends for new Index/Check/Unique and other constraints
| Reported by: | Pavel Tyslacki | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
New in django 2.2 Index condition https://code.djangoproject.com/ticket/29547 and Check/Unique constraints https://code.djangoproject.com/ticket/29641 are a very useful, but have a some issues with extensibility by custom backends:
- sql generation for migrations splitted to
schemaandindexes/constraintsmodules, but custom backend forindexes/constraintsmodules don't appliable - schema logic can be improved for extensibility to avoid huge overriding as
_alter_fieldmethod
to fix it proposed:
- move sql generation from
Index/CheckConstraint/UniqueConstraintto schema methods (similar to_create_index_sql) - provide methods for sql generation for index/unique/primary key/foreign key/check constraints
Change History (4)
comment:1 by , 7 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|---|
| Type: | Uncategorized → Cleanup/optimization |
comment:2 by , 7 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Note:
See TracTickets
for help on using tickets.
PR