1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Refs #32096 -- Made JSONField check respect Meta.required_db_vendor.

Thanks Simon Charette for the implementation idea.
This commit is contained in:
Mariusz Felisiak 2020-10-15 22:05:16 +02:00 committed by GitHub
parent a492ccf0bc
commit 1fb97fb965
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,11 @@ class JSONField(CheckFieldDefaultMixin, Field):
if not router.allow_migrate_model(db, self.model): if not router.allow_migrate_model(db, self.model):
continue continue
connection = connections[db] connection = connections[db]
if (
self.model._meta.required_db_vendor and
self.model._meta.required_db_vendor != connection.vendor
):
continue
if not ( if not (
'supports_json_field' in self.model._meta.required_db_features or 'supports_json_field' in self.model._meta.required_db_features or
connection.features.supports_json_field connection.features.supports_json_field