This commit is contained in:
@@ -30,13 +30,19 @@ namespace AyaNova.Biz
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//CREATE
|
||||
internal async Task<TagGroupMap> CreateAsync(TagGroupMapInfo inObj)
|
||||
{
|
||||
//TODO: see if already present and just return inObj if so
|
||||
// if(ct.TagGroupMap.Any().where)
|
||||
|
||||
//Is this taggroup mapping already present?
|
||||
var Existing = await ct.TagGroupMap.Where(m => m.TagId == inObj.TagId && m.TagGroupId == inObj.TagGroupId).FirstOrDefaultAsync();
|
||||
if (Existing != null)
|
||||
{
|
||||
//yup so just return it, don't make a new one
|
||||
return Existing;
|
||||
}
|
||||
|
||||
|
||||
Validate(inObj, true);
|
||||
@@ -86,7 +92,7 @@ namespace AyaNova.Biz
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -30,12 +30,18 @@ namespace AyaNova.Biz
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//CREATE
|
||||
internal async Task<TagMap> CreateAsync(TagMapInfo inObj)
|
||||
{
|
||||
//TODO: Does object exist before attempting to tag it??
|
||||
//Is this tag already present?
|
||||
var Existing = await ct.TagMap.Where(m => m.TagId == inObj.TagId && m.TagToObjectId == inObj.TagToObjectId && m.TagToObjectType == inObj.TagToObjectType).FirstOrDefaultAsync();
|
||||
if (Existing != null)
|
||||
{
|
||||
//yup so just return it, don't make a new one
|
||||
return Existing;
|
||||
}
|
||||
|
||||
Validate(inObj, true);
|
||||
if (HasErrors)
|
||||
|
||||
@@ -205,7 +205,7 @@ namespace AyaNova.Util
|
||||
if (currentSchema < 6)
|
||||
{
|
||||
LogUpdateMessage(log);
|
||||
|
||||
// LOOKAT: Should taggroupmap have an index that enforces no taggroup can have the same tag more than once? Same for objects being tagged?
|
||||
exec("CREATE TABLE atag (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, name varchar(255) not null)");
|
||||
exec("CREATE UNIQUE INDEX tagname_idx ON atag (name);");
|
||||
exec("CREATE TABLE atagmap (id BIGSERIAL PRIMARY KEY, ownerid bigint not null," +
|
||||
|
||||
Reference in New Issue
Block a user