Opened 14 years ago

Closed 14 years ago

Last modified 13 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

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 14 years ago.
multidb_management_tests.diff (1.8 KB ) - added by marcop 14 years ago.
multidb_management_patch.2.diff (7.2 KB ) - added by marcop 14 years ago.

Download all attachments as: .zip

Change History (7)

by marcop, 14 years ago

by marcop, 14 years ago

by marcop, 14 years ago

comment:1 by marcop, 14 years ago

Patch needs improvement: set

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

comment:2 by Adam Vandenberg, 14 years ago

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

comment:3 by Russell Keith-Magee, 14 years ago

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 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

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