Opened 8 years ago
Last modified 8 years ago
#26926 closed Bug
Dual index migration bug? — at Initial Version
Reported by: | Vladimir | Owned by: | nobody |
---|---|---|---|
Component: | Migrations | Version: | 1.9 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Example:
1) Added new field to model
x_index = models.BooleanField(default=True, db_index=True, unique=True)
There is an unnecessary index. But the conditions of the situation.
2) Create and run the migration.
In the database this field will have only one index - unique.
3) Change the field.
x_index = models.BooleanField(default=True, db_index=True)
Remove the unique index.
4) Create and run the migration.
Now, this field doesn't have of any indexes in database.
Note:
See TracTickets
for help on using tickets.