Skip to content

Commit

Permalink
drop ALTER COLUMN USING clause
Browse files Browse the repository at this point in the history
  • Loading branch information
timgraham committed Aug 31, 2020
1 parent 81052ae commit eb9fedd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
4 changes: 0 additions & 4 deletions django_cockroachdb/creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ def mark_expected_failures(self):
'serializers.test_data.SerializerDataTests.test_python_serializer',
'serializers.test_data.SerializerDataTests.test_xml_serializer',
'serializers.test_data.SerializerDataTests.test_yaml_serializer',
# https://github.com/cockroachdb/cockroach/issues/49329#issuecomment-664677082
'schema.tests.SchemaTests.test_alter',
'schema.tests.SchemaTests.test_alter_numeric_field_keep_null_status',
'schema.tests.SchemaTests.test_alter_smallint_pk_to_smallautofield_pk',
# cockroachdb doesn't distinguish between tables and views. Both
# are included regardless of whether inspectdb's --include-views
# option is set.
Expand Down
3 changes: 0 additions & 3 deletions django_cockroachdb/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ def _alter_field(self, model, old_field, new_field, old_type, new_type,

def _alter_column_type_sql(self, model, old_field, new_field, new_type):
self.sql_alter_column_type = 'ALTER COLUMN %(column)s TYPE %(type)s'
# Cast when data type changed.
if self._field_data_type(old_field) != self._field_data_type(new_field):
self.sql_alter_column_type += ' USING %(column)s::%(type)s'
# Make ALTER TYPE with SERIAL make sense.
# table = strip_quotes(model._meta.db_table)
serial_fields_map = {'bigserial': 'bigint', 'serial': 'integer', 'smallserial': 'smallint'}
Expand Down

0 comments on commit eb9fedd

Please sign in to comment.