1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #31275 -- Optimized sql_flush() without resetting sequences on MySQL.

Co-Authored-By: Simon Charette <charettes@users.noreply.github.com>
This commit is contained in:
c-bata
2020-03-27 01:51:30 +09:00
committed by Mariusz Felisiak
parent 75520e1767
commit 89032876f4
3 changed files with 44 additions and 14 deletions

View File

@@ -347,6 +347,10 @@ Models
* :meth:`.QuerySet.bulk_create` now sets the primary key on objects when using
MariaDB 10.5+.
* The ``DatabaseOperations.sql_flush()`` method now generates more efficient
SQL on MySQL by using ``DELETE`` instead of ``TRUNCATE`` statements for
tables which don't require resetting sequences.
Pagination
~~~~~~~~~~
@@ -415,6 +419,12 @@ Tests
* :class:`~django.test.runner.DiscoverRunner` now skips running the system
checks on databases not :ref:`referenced by tests<testing-multi-db>`.
* :class:`~django.test.TransactionTestCase` teardown is now faster on MySQL
due to :djadmin:`flush` command improvements. As a side effect the latter
doesn't automatically reset sequences on teardown anymore. Enable
:attr:`.TransactionTestCase.reset_sequences` if your tests require this
feature.
URLs
~~~~