Merge pull request #386 from chlupac/DBCreationBug
Database creation bug
This commit is contained in:
commit
50611582df
@ -348,10 +348,10 @@ namespace Oqtane.Infrastructure
|
||||
var user = new User
|
||||
{
|
||||
SiteId = site.SiteId,
|
||||
Username = GetInstallationConfig(SettingKeys.HostUserKey, Constants.HostUser),
|
||||
Username = Constants.HostUser,
|
||||
Password = password,
|
||||
Email = email,
|
||||
DisplayName = GetInstallationConfig(SettingKeys.HostUserKey, Constants.HostUser),
|
||||
DisplayName = Constants.HostUser,
|
||||
};
|
||||
CreateHostUser(folders, userRoles, roles, users, identityUserManager, user);
|
||||
tenant.IsInitialized = true;
|
||||
@ -419,6 +419,7 @@ namespace Oqtane.Infrastructure
|
||||
{
|
||||
using (var db = new InstallationContext(connectionString))
|
||||
{
|
||||
|
||||
//check if DbUp was initialized
|
||||
return TableExists(db, "SchemaVersions");
|
||||
}
|
||||
@ -431,6 +432,7 @@ namespace Oqtane.Infrastructure
|
||||
|
||||
public static bool TableExists(DbContext context, string schema, string tableName)
|
||||
{
|
||||
if (!context.Database.CanConnect()) return false;
|
||||
var connection = context.Database.GetDbConnection();
|
||||
|
||||
if (connection.State.Equals(ConnectionState.Closed))
|
||||
|
@ -2,9 +2,9 @@
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": ""
|
||||
},
|
||||
"Runtime" : "Server",
|
||||
"Installation": {
|
||||
"DefaultAlias": "",
|
||||
"HostUser": "",
|
||||
"HostPassword": "",
|
||||
"HostEmail": "",
|
||||
"SiteTemplate": "",
|
||||
|
Loading…
x
Reference in New Issue
Block a user