diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-02-23 21:12:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-23 21:12:17 +0100 |
commit | 16c966ff7fc9ce01e3afd87ef2af55859cadb587 (patch) | |
tree | 8701aeb960ddfccc70e6223cf2bb6c234eb55c2a /django/db/backends/base/schema.py | |
parent | 5b3d3e400ab9334ba429ca360c9818c6dfc3a51b (diff) | |
download | django-16c966ff7fc9ce01e3afd87ef2af55859cadb587.tar.gz |
Refs #30060, Refs #34217 -- Made SchemaEditor not generate SQL for CheckConstraint if not supported.
The new logic mirrors the logic in SchemaEditor._delete_check_sql()
added in 68ef274bc505cd44f305c03cbf84cf08826200a8.
Thanks Tim Graham for the report.
Diffstat (limited to 'django/db/backends/base/schema.py')
-rw-r--r-- | django/db/backends/base/schema.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py index 070211f6d2..db7e4c69c4 100644 --- a/django/db/backends/base/schema.py +++ b/django/db/backends/base/schema.py @@ -1726,6 +1726,8 @@ class BaseDatabaseSchemaEditor: } def _create_check_sql(self, model, name, check): + if not self.connection.features.supports_table_check_constraints: + return None return Statement( self.sql_create_check, table=Table(model._meta.db_table, self.quote_name), |