This commit is contained in:
2018-08-29 17:05:21 +00:00
parent 5828f617e8
commit 5a421e401e
2 changed files with 28 additions and 13 deletions

View File

@@ -353,6 +353,23 @@ namespace AyaNova
app.UseMvc();
// ******************************************************************
// ******************** TESTING WIPE DB *****************************
//
//Set this to true to wipe the db and reinstall a trial license and re-seed the data
var TESTING_REFRESH_DB = false;
#if (DEBUG)
//TESTING
ServerBootConfig.AYANOVA_PERMANENTLY_ERASE_DATABASE = TESTING_REFRESH_DB;
//TESTING
#endif
if (ServerBootConfig.AYANOVA_PERMANENTLY_ERASE_DATABASE)
{
_log.LogWarning("BOOT: AYANOVA_PERMANENTLY_ERASE_DATABASE is true, dropping and recreating database");
@@ -377,21 +394,19 @@ namespace AyaNova
LocaleBiz lb = new LocaleBiz(dbContext, 1, AuthorizationRoles.OpsAdminFull);
lb.ValidateLocales();
#if (DEBUG)
Util.DbUtil.DropAndRecreateDb(_log);
AySchema.CheckAndUpdate(dbContext, _log);
lb.ValidateLocales();
AyaNova.Core.License.Initialize(apiServerState, dbContext, _log);
AyaNova.Core.License.Fetch(apiServerState, dbContext, _log);
Util.Seeder.SeedDatabase(Util.Seeder.SeedLevel.LargeCorporateMultiRegionalTrialDataSet);
//TESTING
if (TESTING_REFRESH_DB)
{
AyaNova.Core.License.Fetch(apiServerState, dbContext, _log);
Util.Seeder.SeedDatabase(Util.Seeder.SeedLevel.LargeCorporateMultiRegionalTrialDataSet);
}
//TESTING
#endif
//Open up the server for visitors
apiServerState.SetOpen();