File tree Expand file tree Collapse file tree
src/openedx_content/migrations Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,25 +26,15 @@ class Migration(migrations.Migration):
2626 new_name = 'path' ,
2727 ),
2828 # RenameField only changes the Django field name; the DB column is still
29- # '_key' (set via db_column). Use SeparateDatabaseAndState to rename the
30- # actual column and drop the db_column override from state.
31- migrations .SeparateDatabaseAndState (
32- state_operations = [
33- migrations .AlterField (
34- model_name = 'componentversionmedia' ,
35- name = 'path' ,
36- field = openedx_django_lib .fields .MultiCollationCharField (
37- db_collations = {'mysql' : 'utf8mb4_bin' , 'sqlite' : 'BINARY' },
38- max_length = 500 ,
39- ),
40- ),
41- ],
42- database_operations = [
43- migrations .RunSQL (
44- sql = 'ALTER TABLE openedx_content_componentversionmedia RENAME COLUMN _key TO path' ,
45- reverse_sql = 'ALTER TABLE openedx_content_componentversionmedia RENAME COLUMN path TO _key' ,
46- ),
47- ],
29+ # '_key' (set via db_column). AlterField drops db_column, so Django sees
30+ # old column='_key' vs new column='path' and renames it.
31+ migrations .AlterField (
32+ model_name = 'componentversionmedia' ,
33+ name = 'path' ,
34+ field = openedx_django_lib .fields .MultiCollationCharField (
35+ db_collations = {'mysql' : 'utf8mb4_bin' , 'sqlite' : 'BINARY' },
36+ max_length = 500 ,
37+ ),
4838 ),
4939 migrations .AddConstraint (
5040 model_name = 'componentversionmedia' ,
You can’t perform that action at this time.
0 commit comments