diff --git a/django_cockroachdb/creation.py b/django_cockroachdb/creation.py index 97c33ee7..bf63baec 100644 --- a/django_cockroachdb/creation.py +++ b/django_cockroachdb/creation.py @@ -79,10 +79,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. diff --git a/django_cockroachdb/schema.py b/django_cockroachdb/schema.py index 11d90dce..ca2a9da1 100644 --- a/django_cockroachdb/schema.py +++ b/django_cockroachdb/schema.py @@ -44,9 +44,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'}