This commit is contained in:
@@ -353,6 +353,23 @@ namespace AyaNova
|
|||||||
app.UseMvc();
|
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)
|
if (ServerBootConfig.AYANOVA_PERMANENTLY_ERASE_DATABASE)
|
||||||
{
|
{
|
||||||
_log.LogWarning("BOOT: AYANOVA_PERMANENTLY_ERASE_DATABASE is true, dropping and recreating 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);
|
LocaleBiz lb = new LocaleBiz(dbContext, 1, AuthorizationRoles.OpsAdminFull);
|
||||||
lb.ValidateLocales();
|
lb.ValidateLocales();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if (DEBUG)
|
#if (DEBUG)
|
||||||
Util.DbUtil.DropAndRecreateDb(_log);
|
//TESTING
|
||||||
AySchema.CheckAndUpdate(dbContext, _log);
|
if (TESTING_REFRESH_DB)
|
||||||
lb.ValidateLocales();
|
{
|
||||||
AyaNova.Core.License.Initialize(apiServerState, dbContext, _log);
|
AyaNova.Core.License.Fetch(apiServerState, dbContext, _log);
|
||||||
AyaNova.Core.License.Fetch(apiServerState, dbContext, _log);
|
Util.Seeder.SeedDatabase(Util.Seeder.SeedLevel.LargeCorporateMultiRegionalTrialDataSet);
|
||||||
Util.Seeder.SeedDatabase(Util.Seeder.SeedLevel.LargeCorporateMultiRegionalTrialDataSet);
|
}
|
||||||
|
//TESTING
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Open up the server for visitors
|
//Open up the server for visitors
|
||||||
apiServerState.SetOpen();
|
apiServerState.SetOpen();
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace AyaNova.Util
|
|||||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::PrepareDatabaseForSeeding WHEN NEW TABLES ADDED!!!!
|
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::PrepareDatabaseForSeeding WHEN NEW TABLES ADDED!!!!
|
||||||
private const int DESIRED_SCHEMA_LEVEL = 9;
|
private const int DESIRED_SCHEMA_LEVEL = 9;
|
||||||
|
|
||||||
internal const long EXPECTED_COLUMN_COUNT = 75;
|
internal const long EXPECTED_COLUMN_COUNT = 70;
|
||||||
internal const long EXPECTED_INDEX_COUNT = 15;
|
internal const long EXPECTED_INDEX_COUNT = 15;
|
||||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::PrepareDatabaseForSeeding WHEN NEW TABLES ADDED!!!!
|
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::PrepareDatabaseForSeeding WHEN NEW TABLES ADDED!!!!
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ namespace AyaNova.Util
|
|||||||
// exec("CREATE INDEX aytype_idx ON aevent (aytype);");
|
// exec("CREATE INDEX aytype_idx ON aevent (aytype);");
|
||||||
|
|
||||||
//create locale text tables
|
//create locale text tables
|
||||||
exec("CREATE TABLE alocale (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, name varchar(255) not null, stock bool, created timestamp not null)");
|
exec("CREATE TABLE alocale (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, name varchar(255) not null, stock bool)");
|
||||||
exec("CREATE UNIQUE INDEX localename_idx ON alocale (name)");
|
exec("CREATE UNIQUE INDEX localename_idx ON alocale (name)");
|
||||||
exec("CREATE TABLE alocaleitem (id BIGSERIAL PRIMARY KEY, localeid bigint not null REFERENCES alocale (id), key text not null, display text not null)");
|
exec("CREATE TABLE alocaleitem (id BIGSERIAL PRIMARY KEY, localeid bigint not null REFERENCES alocale (id), key text not null, display text not null)");
|
||||||
exec("CREATE INDEX localeitemlid_key_idx ON alocaleitem (localeid,key)");
|
exec("CREATE INDEX localeitemlid_key_idx ON alocaleitem (localeid,key)");
|
||||||
|
|||||||
Reference in New Issue
Block a user