Skip to content

Commit

Permalink
Fix add autofield
Browse files Browse the repository at this point in the history
  • Loading branch information
dauinsight committed Mar 8, 2024
1 parent 026472d commit c6018c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions mssql/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,8 @@ def add_field(self, model, field):
# It might not actually have a column behind it
if definition is None:
return
if col_type_suffix := field.db_type_suffix(connection=self.connection):
definition += f" {col_type_suffix}"
# Remove column type from definition if field is generated
if (django_version >= (5,0) and field.generated):
definition = definition[definition.find('AS'):]
Expand Down
1 change: 0 additions & 1 deletion testapp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@
'db_functions.datetime.test_extract_trunc.DateFunctionWithTimeZoneTests.test_extract_lookup_name_sql_injection',
'db_functions.datetime.test_extract_trunc.DateFunctionTests.test_extract_lookup_name_sql_injection',
'schema.tests.SchemaTests.test_autofield_to_o2o',
'schema.tests.SchemaTests.test_add_auto_field',
'prefetch_related.tests.PrefetchRelatedTests.test_m2m_prefetching_iterator_with_chunks',
'migrations.test_operations.OperationTests.test_create_model_with_boolean_expression_in_check_constraint',
'queries.test_qs_combinators.QuerySetSetOperationTests.test_union_in_subquery_related_outerref',
Expand Down

0 comments on commit c6018c9

Please sign in to comment.