Opened 4 years ago
Closed 4 years ago
#33246 closed Cleanup/optimization (fixed)
--squashed-name can overwrite existing migration files
| Reported by: | AndrewN | Owned by: | AndrewN |
|---|---|---|---|
| Component: | Migrations | 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
squashmigrations --squashed-name initial myapp 0002 will overwrite 0001_initial.py. If that migration has already been applied anywhere, the code and the database will be in an inconsistent state. Furthermore, the 0002_... migration likely depends on 0001_initial, so the new replaces = …0002… line added to 0001_initial.py introduces a CircularDependencyError.
squashmigrations should exit with an error instead of overwriting existing migration files.
Change History (5)
comment:1 by , 4 years ago
comment:2 by , 4 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
| Triage Stage: | Unreviewed → Accepted |
| Type: | Bug → Cleanup/optimization |
comment:3 by , 4 years ago
| Patch needs improvement: | set |
|---|
comment:4 by , 4 years ago
| Patch needs improvement: | unset |
|---|---|
| Triage Stage: | Accepted → Ready for checkin |
Note:
See TracTickets
for help on using tickets.
PR: https://github.com/django/django/pull/15038