[Django] #32083: Multiple Databases example suggest explaining migrate requires --database be specified for non-default

10 views
Skip to first unread message

Django

unread,
Oct 7, 2020, 5:48:57 PM10/7/20
to django-...@googlegroups.com
#32083: Multiple Databases example suggest explaining migrate requires --database
be specified for non-default
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
alligatorbait |
Type: | Status: new
Cleanup/optimization |
Component: | Version:
Documentation | Keywords: migrate, multiple,
Severity: Normal | databases
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
In the Multiple Databases section of the documentation it would be
extremely helpful to know that the migrate command must be run for each
database with --database= for any non-default database. It took me some
time to discover this through a stack-overflow post.

This affects all versions.

https://docs.djangoproject.com/en/2.2/topics/db/multi-db/#an-example

https://stackoverflow.com/questions/35609509/django-migrations-with-
multiple-databases

Thanks, I hope this helps the community.

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

Django

unread,
Oct 7, 2020, 6:04:55 PM10/7/20
to django-...@googlegroups.com
#32083: Multiple Databases example suggest explaining migrate requires --database
be specified for non-default
-------------------------------------+-------------------------------------
Reporter: alligatorbait | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version:
Severity: Normal | Resolution:
Keywords: migrate, multiple, | Triage Stage:
databases | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by JamesTrick):

I believe the behaviour is documented here, under the
[https://docs.djangoproject.com/en/2.2/topics/db/multi-db/#synchronizing-
your-databases Synchronizing your databases] section. Where it says:

''The migrate management command operates on one database at a time. By
default, it operates on the default database, but by providing the
--database option, you can tell it to synchronize a different database.''

Perhaps though, we could add a line in the "An Example" section
referencing the need to specify the database? Especially since that
StackOverflow article has been viewed 13k times.

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

Django

unread,
Oct 7, 2020, 6:23:40 PM10/7/20
to django-...@googlegroups.com
#32083: Multiple Databases example suggest explaining migrate requires --database
be specified for non-default
-------------------------------------+-------------------------------------
Reporter: Tom Weber | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Documentation | Version:
Severity: Normal | Resolution:
Keywords: migrate, multiple, | Triage Stage:
databases | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tom Weber):

Replying to [comment:1 JamesTrick]:


> I believe the behaviour is documented here, under the
[https://docs.djangoproject.com/en/2.2/topics/db/multi-db/#synchronizing-
your-databases Synchronizing your databases] section. Where it says:
>
> ''The migrate management command operates on one database at a time. By
default, it operates on the default database, but by providing the
--database option, you can tell it to synchronize a different database.''
>
> Perhaps though, we could add a line in the "An Example" section
referencing the need to specify the database? Especially since that
StackOverflow article has been viewed 13k times.

Django is such a big project, that even though the documentation contains
all the information I have ever needed, it is not always where I need it
considering related subjects. A reference to the associated migrate
section and reminder to specifically run the migrate command for each
database would have helped in my scenario.

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

Django

unread,
Oct 8, 2020, 4:16:09 AM10/8/20
to django-...@googlegroups.com
#32083: Multiple Databases example suggest explaining migrate requires --database
be specified for non-default
-------------------------------------+-------------------------------------
Reporter: Tom Weber | Owner: Carlton
Type: | Gibson
Cleanup/optimization | Status: assigned

Component: Documentation | Version:
Severity: Normal | Resolution:
Keywords: migrate, multiple, | Triage Stage: Accepted
databases |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* owner: nobody => Carlton Gibson
* status: new => assigned
* stage: Unreviewed => Accepted


Comment:

> Especially since that StackOverflow article has been viewed 13k times.

I think that's probably the essence of it. I edited the SO Answer to link
back to the correct docs section, and opened a
[https://github.com/django/django/pull/13511 PR] to link back there from
the Example section lower down.

Hopefully that should help people find the docs in question.

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

Reply all
Reply to author
Forward
0 new messages