Skip querying model database for Azure database prototypes. (#2095)

This commit is contained in:
Cory Rivera
2023-06-09 15:12:11 -07:00
committed by GitHub
parent 934df0556a
commit f70710124e

View File

@@ -1738,6 +1738,13 @@ WHERE do.database_id = @DbID
this.LoadDefinition(databaseName);
}
else
{
if (context.Server.DatabaseEngineType == DatabaseEngineType.SqlAzureDatabase)
{
// Azure instances don't have a model database we can query, so just use the defaults
this.originalState = new DatabaseData(context);
}
else
{
try
{
@@ -1763,6 +1770,7 @@ WHERE do.database_id = @DbID
context.Server.SetDefaultInitFields(typeof(Database), databaseDefaultInitFields);
this.originalState = new DatabaseData(context);
}
}
// New database should not inherit ReadOnly from model database (Fix TFS 885072)
this.originalState.isReadOnly = false;