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.
--
Ticket URL: <https://code.djangoproject.com/ticket/23808>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0
Comment:
reproduceable on trunk
--
Ticket URL: <https://code.djangoproject.com/ticket/23808#comment:1>
Comment (by mfa):
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
--
Ticket URL: <https://code.djangoproject.com/ticket/23808#comment:2>
* needs_docs: 0 => 1
* component: Migrations => Documentation
Comment:
I don't see a reasonable way to prevent Django from creating this table.
But you are right, this should be documented.
--
Ticket URL: <https://code.djangoproject.com/ticket/23808#comment:3>
* needs_docs: 1 => 0
Comment:
https://github.com/django/django/pull/3515
--
Ticket URL: <https://code.djangoproject.com/ticket/23808#comment:4>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"27c9b3a27d313e75732c1e8e966b320ddbde499d"]:
{{{
#!CommitTicketReference repository=""
revision="27c9b3a27d313e75732c1e8e966b320ddbde499d"
Fixed #23808 -- Documented that migrations table is created when using
runserver without migrating first.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23808#comment:5>
Comment (by Tim Graham <timograham@…>):
In [changeset:"7796f62c36555569125f8bb00cfb8b84b6da4eec"]:
{{{
#!CommitTicketReference repository=""
revision="7796f62c36555569125f8bb00cfb8b84b6da4eec"
[1.7.x] Fixed #23808 -- Documented that migrations table is created when
using runserver without migrating first.
Backport of 27c9b3a27d313e75732c1e8e966b320ddbde499d from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23808#comment:6>
Comment (by Marti Raudsepp):
Discussion for an alternative solution here: #2785
--
Ticket URL: <https://code.djangoproject.com/ticket/23808#comment:7>
Comment (by Tim Graham <timograham@…>):
In [changeset:"fda55c71a8846364b9dc4f4efac4d7034ef6dd6f" fda55c71]:
{{{
#!CommitTicketReference repository=""
revision="fda55c71a8846364b9dc4f4efac4d7034ef6dd6f"
Fixed #27858 -- Prevented read-only management commands from creating the
django_migrations table.
MigrationRecorder now assumes that if the django_migrations table
doesn't exist, then no migrations are applied.
Reverted documentation change from refs #23808.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23808#comment:8>