| 1182 | return "%s_%s" % (self.model_name_lower, self.constraint.name.lower()) |
| 1183 | |
| 1184 | def reduce(self, operation, app_label): |
| 1185 | if ( |
| 1186 | isinstance(operation, RemoveConstraint) |
| 1187 | and self.model_name_lower == operation.model_name_lower |
| 1188 | and self.constraint.name == operation.name |
| 1189 | ): |
| 1190 | return [] |
| 1191 | if ( |
| 1192 | isinstance(operation, AlterConstraint) |
| 1193 | and self.model_name_lower == operation.model_name_lower |
| 1194 | and self.constraint.name == operation.name |
| 1195 | ): |
| 1196 | return [replace(self, constraint=operation.constraint)] |
| 1197 | return super().reduce(operation, app_label) |
| 1198 | |
| 1199 | |
| 1200 | class RemoveConstraint(IndexOperation): |