@@ -75,8 +75,7 @@ def _alter_field(self, model, old_field, new_field, old_type, new_type,
75
75
}
76
76
})
77
77
78
- def _alter_column_type_sql (self , model , old_field , new_field , new_type ):
79
- self .sql_alter_column_type = 'ALTER COLUMN %(column)s TYPE %(type)s'
78
+ def _alter_column_type_sql (self , model , old_field , new_field , new_type , old_collation , new_collation ):
80
79
new_internal_type = new_field .get_internal_type ()
81
80
old_internal_type = old_field .get_internal_type ()
82
81
# Make ALTER TYPE with AutoField make sense.
@@ -90,6 +89,7 @@ def _alter_column_type_sql(self, model, old_field, new_field, new_type):
90
89
self .sql_alter_column_type % {
91
90
"column" : self .quote_name (column ),
92
91
"type" : new_type ,
92
+ "collation" : "" ,
93
93
},
94
94
[],
95
95
),
@@ -99,7 +99,10 @@ def _alter_column_type_sql(self, model, old_field, new_field, new_type):
99
99
[],
100
100
)
101
101
else :
102
- return BaseDatabaseSchemaEditor ._alter_column_type_sql (self , model , old_field , new_field , new_type )
102
+ return BaseDatabaseSchemaEditor ._alter_column_type_sql (
103
+ self , model , old_field , new_field , new_type ,
104
+ old_collation , new_collation ,
105
+ )
103
106
104
107
def _field_should_be_indexed (self , model , field ):
105
108
# Foreign keys are automatically indexed by cockroachdb.
0 commit comments