#14662 closed (invalid)
auth and contenttypes post-syncdb handlers ignore 'db' option
| Reported by: | marcop | Owned by: | nobody |
|---|---|---|---|
| Component: | Contrib apps | Version: | dev |
| Severity: | Keywords: | management muti_db | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | yes |
| Easy pickings: | no | UI/UX: | no |
Description
to reproduce:
- set up two databases in settings: 'default' and 'other'
- make sure database 'default' is not created
- call command
python manage.py syncdb --database=other
attached patch solves the problem
tests attached too.
P.S. also added new --database option to createsuperuser command
Attachments (3)
Change History (7)
by , 15 years ago
| Attachment: | multidb_management_patch.diff added |
|---|
by , 15 years ago
| Attachment: | multidb_management_tests.diff added |
|---|
by , 15 years ago
| Attachment: | multidb_management_patch.2.diff added |
|---|
comment:1 by , 15 years ago
| Patch needs improvement: | set |
|---|
comment:2 by , 15 years ago
Somewhat related to this issue, I think: http://code.djangoproject.com/ticket/12767
comment:3 by , 15 years ago
| milestone: | → 1.3 |
|---|---|
| Resolution: | → invalid |
| Status: | new → closed |
The contenttype and auth post_syncdb handlers ignore --db by design -- they should be (and are) using the router to determine where content types should be written.
If running sycndb on other causes an error because default doesn't exist, then that means you have a dependency in your database setup, and you need to run sycndb on default first. #14799 was the manifestation of this problem in the test suite.
Similarly, createsuperuser shoudn't be overriding the default routing behavior for the User model.
please use multidb_management_patch.2.diff and not the first one attached