#29052: test database setup can truncate non-test database if two database 
aliases
point to the same database
-------------------------------------+-------------------------------------
     Reporter:  Muse                 |                    Owner:  Urth
         Type:  Bug                  |                   Status:  closed
    Component:  Testing framework    |                  Version:  2.0
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Ready for
                                     |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"06e5f7ae1639f1e275e7cc1076dc70ca3ebaa946" 06e5f7ae]:
 {{{
 #!CommitTicketReference repository=""
 revision="06e5f7ae1639f1e275e7cc1076dc70ca3ebaa946"
 Fixed #29052 -- Made test database creation preserve alias order and
 prefer the "default" database.

 This fixes flushing test databases when two aliases point to the same
 database.

 Use a list() to store the test database aliases so the order remains
 stable by following the order of the connections. Also, always use the
 "default" database alias as the first alias to accommodate `migrate`.

 Previously `migrate` could be executed on a secondary alias which
 caused truncating the "default" database.
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29052#comment:6>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.816a49f7f34b34a2759348e816d5fd0f%40djangoproject.com.

Reply via email to