This commit is contained in:
2018-08-28 20:12:51 +00:00
parent ecb6b3d7c6
commit 5cd914767d
17 changed files with 62 additions and 53 deletions

View File

@@ -22,7 +22,7 @@ namespace AyaNova.Util
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::PrepareDatabaseForSeeding WHEN NEW TABLES ADDED!!!!
private const int DESIRED_SCHEMA_LEVEL = 9;
internal const long EXPECTED_COLUMN_COUNT = 76;
internal const long EXPECTED_COLUMN_COUNT = 75;
internal const long EXPECTED_INDEX_COUNT = 15;
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::PrepareDatabaseForSeeding WHEN NEW TABLES ADDED!!!!
@@ -172,7 +172,7 @@ namespace AyaNova.Util
//Add widget table
//id, text, longtext, boolean, currency,
exec("CREATE TABLE awidget (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, name varchar(255) not null, created timestamp not null, " +
exec("CREATE TABLE awidget (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, name varchar(255) not null, " +
"startdate timestamp, enddate timestamp, dollaramount money, active bool, roles int4)");
setSchemaLevel(++currentSchema);

View File

@@ -119,6 +119,7 @@ namespace AyaNova.Util
//2000 widgets
GenSeedWidget(2000, ct);
//GenSeedWidget(100, ct);
break;
//this is a large corporation with multiple branches in multiple locations all in the same country
@@ -257,14 +258,13 @@ namespace AyaNova.Util
//
public static void GenSeedWidget(int count, AyContext ct)
{
var s="blah";
for (int x = 0; x < count; x++)
{
Widget o = new Widget();
var f = new Bogus.Faker();
o.Name = f.Commerce.ProductName();
o.Active = f.Random.Bool();
o.StartDate = f.Date.Between(DateTime.Now, DateTime.Now.AddMinutes(60));
o.EndDate = f.Date.Between(DateTime.Now.AddMinutes(90), DateTime.Now.AddHours(5));
@@ -273,9 +273,13 @@ namespace AyaNova.Util
//this is nonsense but just to test an enum
o.Roles = AuthorizationRoles.DispatchLimited | AuthorizationRoles.InventoryLimited | AuthorizationRoles.OpsAdminLimited;
ct.Widget.Add(o);
ct.SaveChanges();
EventLogProcessor.AddEntry(new Event(o.OwnerId, o.Id, AyaType.Widget, AyaEvent.Created), ct);
// ct.SaveChanges();
//Log
EventLogProcessor.AddEntryNoSave(new Event(o.OwnerId, o.Id, AyaType.Widget, AyaEvent.Created), ct);
}
ct.SaveChanges();
var v=s;
}