#23808 closed Bug (fixed)
manage.py runserver creates django_migrations without concent
Reported by: | jorgecarleitao | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.7 |
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
When you run ./manage.py runserver
on a database without django_migrations
table, the command issues a CREATE
to create the table.
While this seems natural for users trying to run the server the first time, I would not expect a database interaction (specially a CREATE
statement) from a runserver
. The user is not being informed that the database is being changed.
At least, this should be mentioned in the documentation, but IMO it is odd that a runserver
is issuing CREATE
statements.
Of course, this is a consequence of not running manage.py migrate
before.
Change History (8)
comment:1 by , 10 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 10 years ago
The MigrationRecorder seems to create the table if it doesn't exist.
see: https://github.com/django/django/blob/master/django/db/migrations/recorder.py#L43
comment:3 by , 10 years ago
Component: | Migrations → Documentation |
---|---|
Needs documentation: | set |
I don't see a reasonable way to prevent Django from creating this table. But you are right, this should be documented.
comment:5 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:7 by , 8 years ago
Discussion for an alternative solution here: #2785
reproduceable on trunk