#23102: SQL-Management does not work with DATABASE_ROUTERS set
-------------------------------------+-------------------------------------
     Reporter:  manuel.gysin@…       |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Core (Management     |                  Version:  1.7-rc-1
  commands)                          |               Resolution:
     Severity:  Normal               |             Triage Stage:
     Keywords:                       |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by anonymous):

 * status:  closed => new
 * resolution:  needsinfo =>


Comment:

 Hello

 No it have nothing to do with the setting itself.
 There is a different behavior between Django 1.6 and 1.7.

 This gives no output, because SampleModel in the second_db.
 {{{
 [mgysin@localhost Demo]$ python manage.py sqlall SampleModel
 [mgysin@localhost Demo]$
 }}}

 Adjusting the command with --database argument, get things working again:

 {{{
 [mgysin@localhost Demo]$ python manage.py sqlall SampleModel
 --database=second_db
 BEGIN;
 CREATE TABLE "SampleModel_location" (
     "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
     "name" varchar(50) NOT NULL
 )
 ;

 COMMIT;
 }}}

 I'm not sure if this is a design decision or just some side effect with
 Django 1.7.
 But it is very confusing if you are not aware of that. Maybe something
 like 'Only models in the default database are used, for other databases
 please provide --database argument' should be printed?

 I've added an demo sample with this behavior.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/088.fbbd74be17bfffc881f809e55f413892%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to