microsoft / mssql-django

The Microsoft Django backend for SQL Server provides a connectivity layer for Django on SQL Server or Azure SQL DB.
Other
325 stars 108 forks source link

[QUESTION] #384

Open kdadhaniya opened 2 months ago

kdadhaniya commented 2 months ago

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

mShan0 commented 2 months ago

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

Software versions

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

kdadhaniya commented 2 months ago

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,
    },
},

}

mShan0 commented 2 months ago

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