File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 4141from .schema import DatabaseSchemaEditor # noqa
4242
4343EDITION_AZURE_SQL_DB = 5
44-
44+ EDITION_AZURE_SQL_MANAGED_INSTANCE = 8
4545
4646def encode_connection_string (fields ):
4747 """Encode dictionary of keys and values as an ODBC connection String.
@@ -483,7 +483,8 @@ def to_azure_sql_db(self, _known_azures={}):
483483 if self .alias not in _known_azures :
484484 with self .temporary_connection () as cursor :
485485 cursor .execute ("SELECT CAST(SERVERPROPERTY('EngineEdition') AS integer)" )
486- _known_azures [self .alias ] = cursor .fetchone ()[0 ] == EDITION_AZURE_SQL_DB
486+ edition = cursor .fetchone ()[0 ]
487+ _known_azures [self .alias ] = edition == EDITION_AZURE_SQL_DB or edition == EDITION_AZURE_SQL_MANAGED_INSTANCE
487488 return _known_azures [self .alias ]
488489
489490 def _execute_foreach (self , sql , table_names = None ):
You can’t perform that action at this time.
0 commit comments