Skip to content

Commit d4e0429

Browse files
authored
Fix add autofield (#357)
1 parent 32a666d commit d4e0429

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

mssql/schema.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,8 @@ def add_field(self, model, field):
10241024
# It might not actually have a column behind it
10251025
if definition is None:
10261026
return
1027+
if col_type_suffix := field.db_type_suffix(connection=self.connection):
1028+
definition += f" {col_type_suffix}"
10271029
# Remove column type from definition if field is generated
10281030
if (django_version >= (5,0) and field.generated):
10291031
definition = definition[definition.find('AS'):]

testapp/settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@
266266
'db_functions.datetime.test_extract_trunc.DateFunctionWithTimeZoneTests.test_extract_lookup_name_sql_injection',
267267
'db_functions.datetime.test_extract_trunc.DateFunctionTests.test_extract_lookup_name_sql_injection',
268268
'schema.tests.SchemaTests.test_autofield_to_o2o',
269-
'schema.tests.SchemaTests.test_add_auto_field',
270269
'prefetch_related.tests.PrefetchRelatedTests.test_m2m_prefetching_iterator_with_chunks',
271270
'migrations.test_operations.OperationTests.test_create_model_with_boolean_expression_in_check_constraint',
272271
'queries.test_qs_combinators.QuerySetSetOperationTests.test_union_in_subquery_related_outerref',

0 commit comments

Comments
 (0)