Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#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


to reproduce:

  1. set up two databases in settings: 'default' and 'other'
  2. make sure database 'default' is not created
  3. call command python 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 11 years ago.
multidb_management_tests.diff (1.8 KB) - added by marcop 11 years ago.
multidb_management_patch.2.diff (7.2 KB) - added by marcop 11 years ago.

Download all attachments as: .zip

Change History (7)

Changed 11 years ago by marcop

Changed 11 years ago by marcop

Changed 11 years ago by marcop

comment:1 Changed 11 years ago by marcop

Patch needs improvement: set

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

comment:2 Changed 11 years ago by Adam Vandenberg

Somewhat related to this issue, I think:

comment:3 Changed 11 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 10 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

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