On May 16, 2013 1:01 PM, "Jacob Kaplan-Moss" <ja...@jacobian.org> wrote:

> Hi folks --
>
> Does anyone have some clever thoughts on how to solve #16650?
>
> https://code.djangoproject.com/ticket/16550#comment:7 is a good
> summary of the problem: if you're using extensions, you need a way to
> run some custom SQL in tests after the DB gets created by the test
> harness but before syncdb runs.
>
> The current patch and suggested solution on the ticket won't work (see
> the thread), but I think it's a legit need and I'd like to come up
> with a good solution and possibly reopen the ticket.
>
> Jacob
>
> Jacob, going back a couple of levels, if its true that;
- sqlite creates the db for you, and the testdb is created for you
- sqlite could be considered to set permissions for you (ie set the owner
of the db file)
- mysql does *not* create the db, but the testdb *is* created for you
- mysql requires you to issue a "grant all priv on..." on the db, but not
the testdb
- i have no idea about postgresql or oracle.
and ...
- the various db backends know how to craft db specific DDL
then...
- would it be logical for the db backend to create the db for you *if* it
doesn't already exist.

If the above are true, then why can't the same code that creates the testdb
also create the db if it doesn't exist, and that would be the logical place
to hook any post-create-db code such as user-defined data types etc?


This would/could also nullify some questions that new users have when they
get tangled up at the syncdb point of the tutorial if they have not granted
their usercode (from settings) access to the db.

D

-- 
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 django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to