#31286: Database specific fields checks should be databases aware.
-------------------------------------+-------------------------------------
     Reporter:  Hongtao Ma           |                    Owner:  Hongtao
                                     |  Ma
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Ready for
                                     |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  1                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):

 Thanks for sharing your thoughts Tim, having you work on that MongoDB
 backend has been a great source of feedback for the rough edges of build
 such a third-party app.

 The intent of #31055 (0b83c8cc4db95812f1e15ca19d78614e94cf38dd) was two
 fold

 1. Ensure that the check framework is provided the exact set of databases
 it should perform checks against (as not all of them might be available
 all the time, e.g. migrations)
 2. Have the test framework take advantage of 1. as since #28478 test
 database creation is skipped if unneeded.

 Now in retrospect I think that making the `check` command default
 `databases=None` to `[]` instead of `list(connections)` might have been a
 mistake but it's also not clear whether `[DEFAULT_DB_ALIAS]` might not
 have been also a good candidate (that's what other database related
 commands do)

 In summary I wouldn't be opposed to reverting the part of this patch that
 made `check` default to checking all databases (or only the `default` one)
 but we must maintain the part that made check databases aware as it's
 something the migration and testing framework rely on.

 > Although it's documented that "Database checks are not run by default
 because they do more than static code analysis as regular checks do," the
 ​database-specific field checks are only static analysis (as opposed to
 something like ​the MySQL check for strict mode which does query the
 database), so I see no reason they shouldn't be included as part of the
 normal checks.

 I don't disagree in principle but that seems like a totally different can
 of worm isn't it? Database checks
 
[https://github.com/django/django/commit/0b83c8cc4db95812f1e15ca19d78614e94cf38dd
 #diff-
 f10ce154e1f5bcdba92b54ebf8cb57357b404a3f03ab51ca85a031358f7372ecL66-L69
 were never ran by default even prior to this patch] so it has little to do
 this with this particular ticket.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/31286#comment:9>
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 visit 
https://groups.google.com/d/msgid/django-updates/010701960ccb8770-52d387cf-720f-4e4d-93e4-973134123eb4-000000%40eu-central-1.amazonses.com.

Reply via email to