(self, on_delete, feature_flag, databases)
| 1054 | ] |
| 1055 | |
| 1056 | def _check_on_delete_db_support(self, on_delete, feature_flag, databases): |
| 1057 | for db in databases: |
| 1058 | if not router.allow_migrate_model(db, self.model): |
| 1059 | continue |
| 1060 | connection = connections[db] |
| 1061 | if feature_flag in self.model._meta.required_db_features or getattr( |
| 1062 | connection.features, feature_flag |
| 1063 | ): |
| 1064 | continue |
| 1065 | no_db_option_name = on_delete.__name__.removeprefix("DB_") |
| 1066 | yield checks.Error( |
| 1067 | f"{connection.display_name} does not support a {on_delete.__name__}.", |
| 1068 | hint=f"Change the on_delete rule to {no_db_option_name}.", |
| 1069 | obj=self, |
| 1070 | id="fields.E324", |
| 1071 | ) |
| 1072 | |
| 1073 | def _check_on_delete(self, databases): |
| 1074 | on_delete = getattr(self.remote_field, "on_delete", None) |
no test coverage detected