Opened 4 years ago

Closed 4 years ago

#32780 closed Cleanup/optimization (fixed)

Make covering and deferrable UniqueConstraint on SQLite a noop.

Reported by: Hannes Ljungberg Owned by: Hannes Ljungberg
Component: Migrations Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Creating a constraint like UniqueConstraint(fields=['name'], name='name_unq_covering', include=['weight']) on SQLite will issue the warning models.W039 stating that a constraint won't be created even though it is.

Change History (4)

comment:1 by Hannes Ljungberg, 4 years ago

Has patch: set

comment:2 by Mariusz Felisiak, 4 years ago

Patch needs improvement: set
Summary: Make covering UniqueConstraint on SQLite a no-opMake covering and deferrable UniqueConstraint on SQLite a noop.
Triage Stage: UnreviewedAccepted
Type: BugCleanup/optimization

stating that a constraint won't be created even though it is.

That's not true, a constraint won't be created. However I agree that remaking table is not necessary and we can make it a noop. We can do the same for deferrable unique constraints.

comment:3 by Hannes Ljungberg, 4 years ago

That's not true, a constraint won't be created. However I agree that remaking table is not necessary and we can make it a noop. We can do the same for deferrable unique constraints.

Ah! I just assumed that the table would be recreated with the constraint. Thanks for clearing that up!

comment:4 by GitHub <noreply@…>, 4 years ago

Resolution: fixed
Status: assignedclosed

In 3e0fdf5:

Fixed #32780 -- Made Add/RemoveConstraint operations a noop for covering/deferrable unique constraints on SQLite.

Note: See TracTickets for help on using tickets.
Back to Top