#22975 closed Bug (fixed)
Cannot rename model keeping db table name
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 , 11 years ago
Severity: | Normal → Release blocker |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
In dcb4ed517082d13ccf7da9bd5d16c77bcecbf139: