microsoft/mssql-django

[QUESTION]

kdadhaniya opened this issue · 3 comments

Question

I am trying to makemigrations as I altered a model and added NULL=TRUE to one of the fields, but after doing makemigrations, I am getting this error:
django.db.utils.Error: ('IMC06', '[IMC06] [Microsoft][ODBC Driver 18 for SQL Server]The connection is broken and recovery is not possible. The connection is marked by the client driver as unrecoverable. No attempt was made to restore the connection. (0) (SQLExecDirectW)')
I have make previous migrations and have 8 migration files in my migrations folder
Relevant Issues and Pull Requests

Hi @kdadhaniya, can you provide the following information so we can investigate?

Software versions

  • Django:
  • mssql-django:
  • python:
  • SQL Server:
  • OS:

Table schema and Model

Database Connection Settings
// Paste your database settings from Settings.py here.

Steps to reproduce

Error message/stack trace

Any other details that can be helpful

Software versions:
Django==5.0.4
mssql-django==1.4.2
Python: 3.10.13
SQL Server: Microsoft SQL Azure (RTM) - 12.0.2000.8 Feb 2 2024 04:20:23 Copyright (C) 2022 Microsoft Corporation
OS: Mac OS Sonoma 14.2.1

DATABASES = {
'default': {
'ENGINE': 'mssql',
'NAME': 'db_name', # Initial Catalog
'USER': 'user_name', # User ID
'PASSWORD': 'password', # Password
'HOST': 'server.database.windows.net', # Server
'PORT': '1433', # SQL Server default port

    'OPTIONS': {
        'driver': 'ODBC Driver 18 for SQL Server',
        'extra_params': 'Encrypt=yes;TrustServerCertificate=no;',
        'autocommit': True,
    },
},

}

Can I see the models.py that is running into this issue?