This commit is contained in:
@@ -43,7 +43,7 @@ namespace AyaNova.Biz
|
|||||||
return null;
|
return null;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
newObject.Serial = ServerBootConfig.WIDGET_SERIAL.GetNext();
|
// newObject.Serial = ServerBootConfig.WIDGET_SERIAL.GetNext();
|
||||||
newObject.Tags = TagUtil.NormalizeTags(newObject.Tags);
|
newObject.Tags = TagUtil.NormalizeTags(newObject.Tags);
|
||||||
newObject.CustomFields = JsonUtil.CompactJson(newObject.CustomFields);
|
newObject.CustomFields = JsonUtil.CompactJson(newObject.CustomFields);
|
||||||
await ct.Widget.AddAsync(newObject);
|
await ct.Widget.AddAsync(newObject);
|
||||||
@@ -67,7 +67,7 @@ namespace AyaNova.Biz
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Widget newObject = new Widget();
|
Widget newObject = new Widget();
|
||||||
CopyObject.Copy(dbObject, newObject, "Wiki");
|
CopyObject.Copy(dbObject, newObject, "Wiki,Serial");
|
||||||
string newUniqueName = string.Empty;
|
string newUniqueName = string.Empty;
|
||||||
bool NotUnique = true;
|
bool NotUnique = true;
|
||||||
long l = 1;
|
long l = 1;
|
||||||
@@ -77,7 +77,7 @@ namespace AyaNova.Biz
|
|||||||
NotUnique = await ct.Widget.AnyAsync(m => m.Name == newUniqueName);
|
NotUnique = await ct.Widget.AnyAsync(m => m.Name == newUniqueName);
|
||||||
} while (NotUnique);
|
} while (NotUnique);
|
||||||
newObject.Name = newUniqueName;
|
newObject.Name = newUniqueName;
|
||||||
newObject.Serial = ServerBootConfig.WIDGET_SERIAL.GetNext();
|
//newObject.Serial = ServerBootConfig.WIDGET_SERIAL.GetNext();
|
||||||
newObject.Id = 0;
|
newObject.Id = 0;
|
||||||
newObject.Concurrency = 0;
|
newObject.Concurrency = 0;
|
||||||
await ct.Widget.AddAsync(newObject);
|
await ct.Widget.AddAsync(newObject);
|
||||||
@@ -112,7 +112,7 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
Widget SnapshotOfOriginalDBObj = new Widget();
|
Widget SnapshotOfOriginalDBObj = new Widget();
|
||||||
CopyObject.Copy(dbObject, SnapshotOfOriginalDBObj);
|
CopyObject.Copy(dbObject, SnapshotOfOriginalDBObj);
|
||||||
CopyObject.Copy(putObject, dbObject, "Id,Serial");
|
CopyObject.Copy(putObject, dbObject, "Id");//can update serial
|
||||||
dbObject.Tags = TagUtil.NormalizeTags(dbObject.Tags);
|
dbObject.Tags = TagUtil.NormalizeTags(dbObject.Tags);
|
||||||
dbObject.CustomFields = JsonUtil.CompactJson(dbObject.CustomFields);
|
dbObject.CustomFields = JsonUtil.CompactJson(dbObject.CustomFields);
|
||||||
ct.Entry(dbObject).OriginalValues["Concurrency"] = putObject.Concurrency;
|
ct.Entry(dbObject).OriginalValues["Concurrency"] = putObject.Concurrency;
|
||||||
|
|||||||
@@ -137,6 +137,9 @@ namespace AyaNova.Models
|
|||||||
.HasForeignKey<Widget>(b => b.UserId)
|
.HasForeignKey<Widget>(b => b.UserId)
|
||||||
.OnDelete(DeleteBehavior.NoAction);
|
.OnDelete(DeleteBehavior.NoAction);
|
||||||
|
|
||||||
|
|
||||||
|
modelBuilder.Entity<Widget>().Property(z => z.Serial).UseIdentityByDefaultColumn();
|
||||||
|
|
||||||
// //Workorder
|
// //Workorder
|
||||||
// modelBuilder.Entity<WorkOrderItem>()
|
// modelBuilder.Entity<WorkOrderItem>()
|
||||||
// .HasOne(p => p.WorkOrder)
|
// .HasOne(p => p.WorkOrder)
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ namespace AyaNova.Util
|
|||||||
|
|
||||||
//Add widget table
|
//Add widget table
|
||||||
//id, text, longtext, boolean, currency,
|
//id, text, longtext, boolean, currency,
|
||||||
await ExecQueryAsync("CREATE TABLE awidget (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, serial bigint not null," +
|
await ExecQueryAsync("CREATE TABLE awidget (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, serial bigint generated by default as identity not null," +
|
||||||
"startdate timestamp, enddate timestamp, dollaramount decimal(19,5), active bool, usertype int4, count integer," +
|
"startdate timestamp, enddate timestamp, dollaramount decimal(19,5), active bool, usertype int4, count integer," +
|
||||||
"notes text, userid bigint null, wiki text null, customfields text, tags varchar(255) ARRAY)");
|
"notes text, userid bigint null, wiki text null, customfields text, tags varchar(255) ARRAY)");
|
||||||
|
|
||||||
@@ -384,7 +384,7 @@ namespace AyaNova.Util
|
|||||||
|
|
||||||
//----------
|
//----------
|
||||||
//WORKORDER
|
//WORKORDER
|
||||||
await ExecQueryAsync("CREATE TABLE aworkorder (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, serial bigint not null, active bool, " +
|
await ExecQueryAsync("CREATE TABLE aworkorder (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, serial bigint generated by default as identity not null, active bool, " +
|
||||||
"notes text NULL, wiki text null, customfields text NULL, tags varchar(255) ARRAY NULL)");
|
"notes text NULL, wiki text null, customfields text NULL, tags varchar(255) ARRAY NULL)");
|
||||||
await ExecQueryAsync("CREATE INDEX aworkorder_serial_id_idx ON aworkorder (id, serial);");//is this necessary or fruitful?
|
await ExecQueryAsync("CREATE INDEX aworkorder_serial_id_idx ON aworkorder (id, serial);");//is this necessary or fruitful?
|
||||||
await ExecQueryAsync("CREATE INDEX aworkorder_tags ON aworkorder using GIN(tags)");
|
await ExecQueryAsync("CREATE INDEX aworkorder_tags ON aworkorder using GIN(tags)");
|
||||||
|
|||||||
Reference in New Issue
Block a user