Opened 8 years ago
Closed 8 years ago
#28481 closed Bug (fixed)
migrate --fake produces stale content type warning when CreateModel exists in non-initial migration
| Reported by: | Amanda Ng | Owned by: | nobody |
|---|---|---|---|
| Component: | Migrations | Version: | 1.10 |
| 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
When a new table creation is specified in a subsequent (i.e. non 0001_initial.py) migration, and python manage.py migrate --fake is run, it prompts for deletion of the table as a "stale content type".
Steps to reproduce:
- Create new project.
- Create new app.
- Create a table (e.g. class table1(models.Model)...) in app.
- Run "python manage.py makemigrations"
- Run "python manage.py migrate"
- Create a new table in app (e.g. class table2(models.Model)...) in app.
- Add foreign key to table 1 in table 2.
- Run "python manage.py makemigrations"
- Run "python manage.py migrate"
- Delete 0002_* entry from django_migrations table
- Run "python manage.py migrate --fake"
Note:
See TracTickets
for help on using tickets.
I guess this is fixed in Django 1.11 because (quoting the 1.11 release notes) "The prompt for stale content type deletion no longer occurs after running the
migratecommand. Use the newremove_stale_contenttypescommand instead." (#24865)