diff options
| author | Simon Charette <charette.s@gmail.com> | 2020-02-07 08:46:13 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-02-07 11:01:31 +0100 |
| commit | 0b83c8cc4db95812f1e15ca19d78614e94cf38dd (patch) | |
| tree | 2b271945fc9ab4c9d8f88ba6ad29263ec7562bb7 /docs | |
| parent | 9cc743d0c82e019306d80eb8a83f86f8c6244610 (diff) | |
Refs #31055 -- Added --database option to the check management command.
This avoids enabling the ``database`` checks unless they are explicitly
requested and allows to disable on a per-alias basis which is required
when only creating a subset of the test databases.
This also removes unnecessary BaseCommand._run_checks() hook.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/checks.txt | 8 | ||||
| -rw-r--r-- | docs/ref/django-admin.txt | 10 | ||||
| -rw-r--r-- | docs/releases/3.1.txt | 11 |
3 files changed, 27 insertions, 2 deletions
diff --git a/docs/ref/checks.txt b/docs/ref/checks.txt index e7b0a5ec8c..99d5fccfaa 100644 --- a/docs/ref/checks.txt +++ b/docs/ref/checks.txt @@ -79,7 +79,8 @@ Django's system checks are organized using the following tags: * ``database``: Checks database-related configuration issues. Database checks are not run by default because they do more than static code analysis as regular checks do. They are only run by the :djadmin:`migrate` command or if - you specify the ``database`` tag when calling the :djadmin:`check` command. + you specify configured database aliases using the ``--database`` option when + calling the :djadmin:`check` command. * ``models``: Checks of model, field, and manager definitions. * ``security``: Checks security related configuration. * ``signals``: Checks on signal declarations and handler registrations. @@ -90,6 +91,11 @@ Django's system checks are organized using the following tags: Some checks may be registered with multiple tags. +.. versionchanged:: 3.1 + + The ``database`` checks are now run only for database aliases specified + using the :option:`check --database` option. + Core system checks ================== diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index 3f95d8e1ce..a5ef671e26 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -106,6 +106,16 @@ For example, to perform only models and compatibility checks, run:: django-admin check --tag models --tag compatibility +.. django-admin-option:: --database DATABASE + +.. versionadded:: 3.1 + +Specifies the database to run checks requiring database access:: + + django-admin check --database default --database other + +By default, these checks will not be run. + .. django-admin-option:: --list-tags Lists all available tags. diff --git a/docs/releases/3.1.txt b/docs/releases/3.1.txt index 58fed5080a..fbce69d820 100644 --- a/docs/releases/3.1.txt +++ b/docs/releases/3.1.txt @@ -229,7 +229,10 @@ Logging Management Commands ~~~~~~~~~~~~~~~~~~~ -* ... +* The new :option:`check --database` option allows specifying database aliases + for running the ``database`` system checks. Previously these checks were + enabled for all configured :setting:`DATABASES` by passing the ``database`` + tag to the command. Migrations ~~~~~~~~~~ @@ -474,6 +477,12 @@ Miscellaneous *What's New* :ref:`Security section <whats-new-security-3.1>` above for more details. +* :djadmin:`check` management command now runs the ``database`` system checks + only for database aliases specified using :option:`check --database` option. + +* :djadmin:`migrate` management command now runs the ``database`` system checks + only for a database to migrate. + .. _deprecated-features-3.1: Features deprecated in 3.1 |
