Hey!

I think I've found a bug in flush command, but I'm not sure (maybe I don't 
understand Django ethos?) so I'm writing here.

I have multiple databases (PostgreSQL) and multiple apps in my projects. 
I'm using Django v1.5.1. 
Models are routed by my specific database router, so some apps are 
connected to database A, some to db B, and so on...

I'm trying to flush all databases for tests (calling flush for each 
database separately) and every sqlflush fails. Why? Because 
django.core.management.sql.sql_flush is called with only_django with 
only_existing=True that produces truncate sql for really existing tables in 
specified database (via --database argument), which is ok, BUT next step is 
a resetting ALL sequences for ALL models fetched from 
connection.introspection.sequence_list(). And that SQL simply fails. 
 Generated SQL for database A contains sequences for ALL tables and ALL 
defined databases, which simply fails.

I've tried to filter tables in sequence_list(), which is not good solution, 
but enough to ensure. And guess what? - flush command passed without errors.

Have you ever found that issue? 
Does anyone is using multiple databases with postgres backend (probably 
there is no issue with mysql)?
Or maybe I'm doing something wrong?

Kind Regards,
Marcin

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" 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].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/7f52c7ef-013b-4390-bf55-a57ad96e1c9d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to