From 1fb97fb965786a4398a2236e4e619b78a25d5875 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Thu, 15 Oct 2020 22:05:16 +0200 Subject: [PATCH] Refs #32096 -- Made JSONField check respect Meta.required_db_vendor. Thanks Simon Charette for the implementation idea. --- django/db/models/fields/json.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/django/db/models/fields/json.py b/django/db/models/fields/json.py index d0a55ac1e7..5b0272a945 100644 --- a/django/db/models/fields/json.py +++ b/django/db/models/fields/json.py @@ -45,6 +45,11 @@ class JSONField(CheckFieldDefaultMixin, Field): if not router.allow_migrate_model(db, self.model): continue connection = connections[db] + if ( + self.model._meta.required_db_vendor and + self.model._meta.required_db_vendor != connection.vendor + ): + continue if not ( 'supports_json_field' in self.model._meta.required_db_features or connection.features.supports_json_field