#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
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

 In [changeset:"b89ce413f2a95f22788efb01d441f7ab3b506003" b89ce413]:
 {{{
 #!CommitTicketReference repository=""
 revision="b89ce413f2a95f22788efb01d441f7ab3b506003"
 [3.2.x] 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.

 Backport of 06e5f7ae1639f1e275e7cc1076dc70ca3ebaa946 from master
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29052#comment:7>
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.9942b6f514eb980ce57fa588921a9da0%40djangoproject.com.

Reply via email to