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):
102102 "schema.tests.SchemaTests.test_alter_null_to_not_null" ,
103103 "schema.tests.SchemaTests.test_alter_primary_key_the_same_name" ,
104104 "schema.tests.SchemaTests.test_autofield_to_o2o" ,
105- # AlterField (rename)
106- "schema.tests.SchemaTests.test_rename" ,
107105 # AlterField (db_index)
108106 "schema.tests.SchemaTests.test_indexes" ,
109107 "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(
3838 new_db_params ,
3939 strict = False ,
4040 ):
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+ )
4246
4347 def remove_field (self , model , field ):
4448 # Remove implicit M2M tables.
You can’t perform that action at this time.
0 commit comments