[Django] #23808: manage.py runserver creates django_migrations without concent

46 views
Skip to first unread message

Django

unread,
Nov 12, 2014, 4:24:07 PM11/12/14
to django-...@googlegroups.com
#23808: manage.py runserver creates django_migrations without concent
--------------------------------+--------------------
Reporter: jorgecarleitao | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/23808>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 15, 2014, 4:47:39 AM11/15/14
to django-...@googlegroups.com
#23808: manage.py runserver creates django_migrations without concent
--------------------------------+------------------------------------

Reporter: jorgecarleitao | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------
Changes (by mfa):

* 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>

Django

unread,
Nov 15, 2014, 5:20:20 AM11/15/14
to django-...@googlegroups.com
#23808: manage.py runserver creates django_migrations without concent
--------------------------------+------------------------------------

Reporter: jorgecarleitao | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------

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>

Django

unread,
Nov 15, 2014, 5:29:52 AM11/15/14
to django-...@googlegroups.com
#23808: manage.py runserver creates django_migrations without concent
--------------------------------+------------------------------------

Reporter: jorgecarleitao | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------
Changes (by MarkusH):

* 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>

Django

unread,
Nov 15, 2014, 5:59:34 AM11/15/14
to django-...@googlegroups.com
#23808: manage.py runserver creates django_migrations without concent
--------------------------------+------------------------------------

Reporter: jorgecarleitao | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------
Changes (by mfa):

* needs_docs: 1 => 0


Comment:

https://github.com/django/django/pull/3515

--
Ticket URL: <https://code.djangoproject.com/ticket/23808#comment:4>

Django

unread,
Nov 15, 2014, 2:03:42 PM11/15/14
to django-...@googlegroups.com
#23808: manage.py runserver creates django_migrations without concent
--------------------------------+------------------------------------
Reporter: jorgecarleitao | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: 1.7
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* 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>

Django

unread,
Nov 15, 2014, 2:06:28 PM11/15/14
to django-...@googlegroups.com
#23808: manage.py runserver creates django_migrations without concent
--------------------------------+------------------------------------
Reporter: jorgecarleitao | Owner: nobody

Type: Bug | Status: closed
Component: Documentation | Version: 1.7
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------

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>

Django

unread,
Feb 20, 2017, 10:36:40 AM2/20/17
to django-...@googlegroups.com
#23808: manage.py runserver creates django_migrations without concent
--------------------------------+------------------------------------
Reporter: jorgecarleitao | Owner: nobody

Type: Bug | Status: closed
Component: Documentation | Version: 1.7
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------

Comment (by Marti Raudsepp):

Discussion for an alternative solution here: #2785

--
Ticket URL: <https://code.djangoproject.com/ticket/23808#comment:7>

Django

unread,
Jun 19, 2017, 1:28:29 PM6/19/17
to django-...@googlegroups.com
#23808: manage.py runserver creates django_migrations without concent
--------------------------------+------------------------------------
Reporter: jorgecarleitao | Owner: nobody

Type: Bug | Status: closed
Component: Documentation | Version: 1.7
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------

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>

Reply all
Reply to author
Forward
0 new messages