File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -102,8 +102,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
102
102
"schema.tests.SchemaTests.test_alter_null_to_not_null" ,
103
103
"schema.tests.SchemaTests.test_alter_primary_key_the_same_name" ,
104
104
"schema.tests.SchemaTests.test_autofield_to_o2o" ,
105
- # AlterField (rename)
106
- "schema.tests.SchemaTests.test_rename" ,
107
105
# AlterField (db_index)
108
106
"schema.tests.SchemaTests.test_indexes" ,
109
107
"schema.tests.SchemaTests.test_remove_constraints_capital_letters" ,
Original file line number Diff line number Diff line change @@ -38,7 +38,11 @@ def _alter_field(
38
38
new_db_params ,
39
39
strict = False ,
40
40
):
41
- pass
41
+ # Have they renamed the column?
42
+ if old_field .column != new_field .column :
43
+ self .connection .database [model ._meta .db_table ].update_many (
44
+ {}, {"$rename" : {old_field .column : new_field .column }}
45
+ )
42
46
43
47
def remove_field (self , model , field ):
44
48
# Remove implicit M2M tables.
You can’t perform that action at this time.
0 commit comments