Opened 11 years ago
Closed 11 years ago
#21305 closed Bug (fixed)
Implement initial migration detection
Reported by: | Tim Graham | Owned by: | Andrew Godwin |
---|---|---|---|
Component: | Migrations | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Currently documented functionality in topics/migrations is not implemented: "This will make a new initial migration for your app. Now, when you run migrate, Django will detect that you have an initial migration and that the tables it wants to create already exist, and will mark the migration as already applied."
On SQLite, for example, you get this traceback: django.db.utils.OperationalError: table polls_poll already exists
Change History (2)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
In e9cb333bc359a31c548c97dc07e392cfe39be18e:
Auto-apply initial migrations if their tables exist already.
I wrote a test for this here: https://github.com/tim-schilling/django/commit/302ad27c2cfe0cd8765ebfa5312600056f797d27