mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
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 68ef274bc5.
Thanks Tim Graham for the report.
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user