#22975 closed Bug (fixed)
Cannot rename model keeping db table name
Reported by: | rhcarvalho | Owned by: | nobody |
---|---|---|---|
Component: | Migrations | Version: | 1.7-rc-1 |
Severity: | Release blocker | Keywords: | migrations |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Django migrations do not work when you rename a model keeping the db table name. For instance:
# -- models.py --
class Book(models.Model):
name = models.CharField()
class Meta:
db_table = "books"
# -- models.py after renaming model --
class AwesomeBook(models.Model):
name = models.CharField()
class Meta:
db_table = "books"
The migration system ends up making an operational error by trying to rename the table from books
to books
, when the rename is unnecessary.
Change History (3)
comment:1 by , 10 years ago
Severity: | Normal → Release blocker |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
In dcb4ed517082d13ccf7da9bd5d16c77bcecbf139: