Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#14662 closed (invalid)

auth and contenttypes post-syncdb handlers ignore 'db' option

Reported by: marcop Owned by: nobody
Component: Contrib apps Version: master
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:

  1. set up two databases in settings: 'default' and 'other'
  2. make sure database 'default' is not created
  3. 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)

multidb_management_patch.diff (7.4 KB) - added by marcop 10 years ago.
multidb_management_tests.diff (1.8 KB) - added by marcop 10 years ago.
multidb_management_patch.2.diff (7.2 KB) - added by marcop 10 years ago.

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by marcop

Changed 10 years ago by marcop

Changed 10 years ago by marcop

comment:1 Changed 10 years ago by marcop

Patch needs improvement: set

please use multidb_management_patch.2.diff and not the first one attached

comment:2 Changed 10 years ago by Adam Vandenberg

Somewhat related to this issue, I think: http://code.djangoproject.com/ticket/12767

comment:3 Changed 10 years ago by Russell Keith-Magee

milestone: 1.3
Resolution: invalid
Status: newclosed

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.

comment:4 Changed 9 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top