#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
schema
andindexes
/constraints
modules, but custom backend forindexes
/constraints
modules don't appliable - schema logic can be improved for extensibility to avoid huge overriding as
_alter_field
method
to fix it proposed:
- move sql generation from
Index
/CheckConstraint
/UniqueConstraint
to 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 , 6 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → Cleanup/optimization |
comment:2 by , 6 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Note:
See TracTickets
for help on using tickets.
PR