#15255: DB Cache table creation (createcachetable) ignores the DB Router
--------------------------+-------------------------------------------------
 Reporter:  zvikico       |          Owner:  nobody    
   Status:  new           |      Milestone:            
Component:  Cache system  |        Version:  1.3-beta  
 Keywords:                |   Triage Stage:  Unreviewed
Has patch:  0             |  
--------------------------+-------------------------------------------------
 When using database-based cache (using
 django.core.cache.backends.db.DatabaseCache cache backend), one uses the
 createcachetable command to create the table. This command completely
 ignores any database routers (in multiple databases situation) which are
 installed in the settings file. Instead, one can specify a target database
 with the --database option.

 One could argue that this is not a bug, but rather a feature (undocumented
 one, none the less). However, the DatabaseCache class itself does use the
 installed router. This creates a confusion: if the router routes to a
 different database, one may install the table on the wrong database, but
 will not be able to access it.

 I believe the best approach is to follow the syncdb convention: the cache
 table should not be created when the router returns false form the
 allow_syncdb method. The table will only be created when the matching DB
 is specified (or for the default if it is relevant).

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15255>
Django <http://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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to