[Django] #27110: [regression] makemigrations creates `django_migrations` table in external databases

30 views
Skip to first unread message

Django

unread,
Aug 23, 2016, 8:20:36 AM8/23/16
to django-...@googlegroups.com
#27110: [regression] makemigrations creates `django_migrations` table in external
databases
-------------------------------+------------------------
Reporter: direx | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.10
Severity: Normal | Keywords: regression
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------
In Django 1.10 the `makemigrations` command creates a database table
`django_migrations` in '''all databases''' defined in
`settings.DATABASES`. In Django 1.9 and earlier this was not the case.

This behavior is bad if no (or only unmanaged) models reside in these
databases. In my case I have quite a lot of databases defined in
`settings.DATABASES` to be able to connect to them in a unified way. I
only do raw SQL in there, so Django should not mess with these databases
(or worse, introduce schema changes in third-party databases, like Django
1.10 does).

This is somewhat related to Bug #27054, although the fix provided there
does not solve the issue. This regression is introduced by
02ae5fd31a56ffb42feadb49c1f3870ba0a24869.

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

Django

unread,
Aug 23, 2016, 10:28:49 AM8/23/16
to django-...@googlegroups.com
#27110: makemigrations shouldn't create `django_migrations` table in external
databases
---------------------------------+-------------------------------------
Reporter: direx | Owner: timgraham
Type: Bug | Status: assigned
Component: Migrations | Version: 1.10
Severity: Release blocker | Resolution:
Keywords: regression | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* status: new => assigned
* severity: Normal => Release blocker
* needs_better_patch: => 0
* component: Uncategorized => Migrations
* needs_tests: => 0
* owner: nobody => timgraham
* needs_docs: => 0
* type: Uncategorized => Bug
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/27110#comment:1>

Django

unread,
Aug 23, 2016, 11:01:04 AM8/23/16
to django-...@googlegroups.com
#27110: makemigrations shouldn't create `django_migrations` table in external
databases

---------------------------------+-------------------------------------
Reporter: direx | Owner: timgraham
Type: Bug | Status: assigned
Component: Migrations | Version: 1.10
Severity: Release blocker | Resolution:
Keywords: regression | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/7142 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/27110#comment:2>

Django

unread,
Aug 30, 2016, 9:39:29 PM8/30/16
to django-...@googlegroups.com
#27110: makemigrations shouldn't create `django_migrations` table in external
databases

---------------------------------+-------------------------------------
Reporter: direx | Owner: timgraham
Type: Bug | Status: assigned
Component: Migrations | Version: 1.10
Severity: Release blocker | Resolution:
Keywords: regression | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

Comment (by timgraham):

An alternate proposal about consulting database routers is under
discussion in #27142. It would be nice to have some confirmation that it
solves your use case.

--
Ticket URL: <https://code.djangoproject.com/ticket/27110#comment:3>

Django

unread,
Aug 31, 2016, 8:15:04 PM8/31/16
to django-...@googlegroups.com
#27110: makemigrations shouldn't create `django_migrations` table in external
databases

---------------------------------+-------------------------------------
Reporter: direx | Owner: timgraham
Type: Bug | Status: assigned
Component: Migrations | Version: 1.10
Severity: Release blocker | Resolution:
Keywords: regression | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

Comment (by timgraham):

There's a [https://github.com/django/django/pull/7194 new PR] which uses
the database routers idea.

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

Django

unread,
Sep 1, 2016, 4:19:37 PM9/1/16
to django-...@googlegroups.com
#27110: makemigrations shouldn't create `django_migrations` table in external
databases

---------------------------------+-------------------------------------
Reporter: direx | Owner: timgraham
Type: Bug | Status: closed
Component: Migrations | Version: 1.10
Severity: Release blocker | Resolution: fixed

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

Easy pickings: 0 | UI/UX: 0
---------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"098c07a03286b5ed133102733e67a83061647ea0" 098c07a]:
{{{
#!CommitTicketReference repository=""
revision="098c07a03286b5ed133102733e67a83061647ea0"
Fixed #27142, #27110 -- Made makemigrations consistency checks respect
database routers.

Partially reverted refs #27054 except for one of the tests as this
solution supersedes that one.

Thanks Shai Berger for the review.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27110#comment:5>

Django

unread,
Sep 1, 2016, 4:24:20 PM9/1/16
to django-...@googlegroups.com
#27110: makemigrations shouldn't create `django_migrations` table in external
databases

---------------------------------+-------------------------------------
Reporter: direx | Owner: timgraham
Type: Bug | Status: closed
Component: Migrations | Version: 1.10
Severity: Release blocker | Resolution: fixed
Keywords: regression | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

Comment (by Tim Graham <timograham@…>):

In [changeset:"3e913d214133ca92329ed95d55bd881e42d487ef" 3e913d2]:
{{{
#!CommitTicketReference repository=""
revision="3e913d214133ca92329ed95d55bd881e42d487ef"
[1.10.x] Fixed #27142, #27110 -- Made makemigrations consistency checks
respect database routers.

Partially reverted refs #27054 except for one of the tests as this
solution supersedes that one.

Thanks Shai Berger for the review.

Backport of 098c07a03286b5ed133102733e67a83061647ea0 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27110#comment:6>

Django

unread,
Sep 1, 2016, 6:50:19 PM9/1/16
to django-...@googlegroups.com
#27110: makemigrations shouldn't create `django_migrations` table in external
databases

---------------------------------+-------------------------------------
Reporter: direx | Owner: timgraham
Type: Bug | Status: closed
Component: Migrations | Version: 1.10
Severity: Release blocker | Resolution: fixed
Keywords: regression | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

Comment (by Tim Graham <timograham@…>):

In [changeset:"c93ac9cf42bff259ab71b70a89b693b9c38e4666" c93ac9cf]:
{{{
#!CommitTicketReference repository=""
revision="c93ac9cf42bff259ab71b70a89b693b9c38e4666"
Refs #25850, #27142, #27110 -- Documented migration history consistency
checks.
}}}

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

Django

unread,
Sep 1, 2016, 6:50:25 PM9/1/16
to django-...@googlegroups.com
#27110: makemigrations shouldn't create `django_migrations` table in external
databases

---------------------------------+-------------------------------------
Reporter: direx | Owner: timgraham
Type: Bug | Status: closed
Component: Migrations | Version: 1.10
Severity: Release blocker | Resolution: fixed
Keywords: regression | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

Comment (by Tim Graham <timograham@…>):

In [changeset:"57f7d8968d8443352ce331ad9dd6f433a15d0d93" 57f7d896]:
{{{
#!CommitTicketReference repository=""
revision="57f7d8968d8443352ce331ad9dd6f433a15d0d93"
[1.10.x] Refs #25850, #27142, #27110 -- Documented migration history
consistency checks.

Backport of c93ac9cf42bff259ab71b70a89b693b9c38e4666 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27110#comment:8>

Reply all
Reply to author
Forward
0 new messages