(self, operation, app_label)
| 255 | return "alter_%s_%s" % (self.model_name_lower, self.name_lower) |
| 256 | |
| 257 | def reduce(self, operation, app_label): |
| 258 | if isinstance( |
| 259 | operation, (AlterField, RemoveField) |
| 260 | ) and self.is_same_field_operation(operation): |
| 261 | return [operation] |
| 262 | elif ( |
| 263 | isinstance(operation, RenameField) |
| 264 | and self.is_same_field_operation(operation) |
| 265 | and self.field.db_column is None |
| 266 | ): |
| 267 | return [ |
| 268 | operation, |
| 269 | replace(self, name=operation.new_name), |
| 270 | ] |
| 271 | return super().reduce(operation, app_label) |
| 272 | |
| 273 | |
| 274 | class RenameField(FieldOperation): |
nothing calls this directly
no test coverage detected