Merge pull request #5555 from sbwalker/dev

remove hardcoded references to LocalDB
This commit is contained in:
Shaun Walker
2025-08-29 17:17:27 -04:00
committed by GitHub
5 changed files with 8 additions and 5 deletions

View File

@ -182,7 +182,7 @@
} }
else else
{ {
_databaseName = "LocalDB"; _databaseName = Constants.DefaultDBName;
} }
LoadDatabaseConfigComponent(); LoadDatabaseConfigComponent();

View File

@ -665,7 +665,8 @@
if (tenant != null) if (tenant != null)
{ {
_tenant = tenant.Name; _tenant = tenant.Name;
_database = _databases.Find(item => item.DBType == tenant.DBType && item.Name != "LocalDB")?.Name; // hack - there are 3 providers with SqlServerDatabase DBTypes - so we are choosing the last one in alphabetical order
_database = _databases.Where(item => item.DBType == tenant.DBType).OrderBy(item => item.Name).Last()?.Name;
_connectionstring = tenant.DBConnectionString; _connectionstring = tenant.DBConnectionString;
} }
} }

View File

@ -237,7 +237,7 @@ else
} }
else else
{ {
_databaseName = "LocalDB"; _databaseName = Constants.DefaultDBName;
} }
LoadDatabaseConfigComponent(); LoadDatabaseConfigComponent();
} }

View File

@ -200,7 +200,8 @@ else
if (tenant != null) if (tenant != null)
{ {
_tenant = tenant.Name; _tenant = tenant.Name;
_databasetype = _databases.FirstOrDefault(item => item.DBType == tenant.DBType && item.Name != "LocalDB").Name; // hack - there are 3 providers with SqlServerDatabase DBTypes - so we are choosing the last one in alphabetical order
_databasetype = _databases.Where(item => item.DBType == tenant.DBType).OrderBy(item => item.Name).Last()?.Name;
} }
} }
else else
@ -211,7 +212,7 @@ else
} }
else else
{ {
_databasetype = "LocalDB"; _databasetype = Constants.DefaultDBName;
} }
_showConnectionString = false; _showConnectionString = false;
LoadDatabaseConfigComponent(); LoadDatabaseConfigComponent();

View File

@ -12,6 +12,7 @@ namespace Oqtane.Shared
public const string PackageRegistryUrl = "https://www.oqtane.net"; public const string PackageRegistryUrl = "https://www.oqtane.net";
public const string DataDirectory = "DataDirectory"; public const string DataDirectory = "DataDirectory";
public const string DefaultDBName = "LocalDB";
public const string DefaultDBType = "Oqtane.Database.SqlServer.SqlServerDatabase, Oqtane.Server"; public const string DefaultDBType = "Oqtane.Database.SqlServer.SqlServerDatabase, Oqtane.Server";
public const string DefaultTheme = "Oqtane.Themes.OqtaneTheme.Default, Oqtane.Client"; public const string DefaultTheme = "Oqtane.Themes.OqtaneTheme.Default, Oqtane.Client";