This commit is contained in:
@@ -44,7 +44,7 @@ namespace AyaNova.Biz
|
|||||||
{
|
{
|
||||||
//Add / increase reference count for added tags
|
//Add / increase reference count for added tags
|
||||||
//remove / decrease reference count for removed tags
|
//remove / decrease reference count for removed tags
|
||||||
var v=ct.Event.Any(x=>x.Textra=="word");
|
// var v=ct.Event.Any(x=>x.Textra=="word");
|
||||||
//https://stackoverflow.com/questions/10233298/increment-a-value-in-postgres
|
//https://stackoverflow.com/questions/10233298/increment-a-value-in-postgres
|
||||||
/*
|
/*
|
||||||
ONE SHOT WAY WHICH IS BOSS!!
|
ONE SHOT WAY WHICH IS BOSS!!
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ namespace AyaNova.Models
|
|||||||
public virtual DbSet<Locale> Locale { get; set; }
|
public virtual DbSet<Locale> Locale { get; set; }
|
||||||
public virtual DbSet<LocaleItem> LocaleItem { get; set; }
|
public virtual DbSet<LocaleItem> LocaleItem { get; set; }
|
||||||
public virtual DbSet<DataFilter> DataFilter { get; set; }
|
public virtual DbSet<DataFilter> DataFilter { get; set; }
|
||||||
|
public virtual DbSet<Tag> Tag { get; set; }
|
||||||
|
|
||||||
//Note: had to add this constructor to work with the code in startup.cs that gets the connection string from the appsettings.json file
|
//Note: had to add this constructor to work with the code in startup.cs that gets the connection string from the appsettings.json file
|
||||||
//and commented out the above on configuring
|
//and commented out the above on configuring
|
||||||
|
|||||||
21
server/AyaNova/models/Tag.cs
Normal file
21
server/AyaNova/models/Tag.cs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using AyaNova.Biz;
|
||||||
|
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace AyaNova.Models
|
||||||
|
{
|
||||||
|
|
||||||
|
public partial class Tag
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
public uint ConcurrencyToken { get; set; }
|
||||||
|
|
||||||
|
[Required, MaxLength(255)]
|
||||||
|
public string Name { get; set; }//max 255 characters
|
||||||
|
|
||||||
|
public long RefCount { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,13 +19,13 @@ namespace AyaNova.Util
|
|||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
/////////// CHANGE THIS ON NEW SCHEMA UPDATE ////////////////////
|
/////////// CHANGE THIS ON NEW SCHEMA UPDATE ////////////////////
|
||||||
|
|
||||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::PrepareDatabaseForSeeding WHEN NEW TABLES ADDED!!!!
|
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
||||||
private const int DESIRED_SCHEMA_LEVEL = 8;
|
private const int DESIRED_SCHEMA_LEVEL = 8;
|
||||||
|
|
||||||
internal const long EXPECTED_COLUMN_COUNT = 95;
|
internal const long EXPECTED_COLUMN_COUNT = 98;
|
||||||
internal const long EXPECTED_INDEX_COUNT = 20;
|
internal const long EXPECTED_INDEX_COUNT = 22;
|
||||||
|
|
||||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::PrepareDatabaseForSeeding WHEN NEW TABLES ADDED!!!!
|
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -302,7 +302,16 @@ namespace AyaNova.Util
|
|||||||
|
|
||||||
exec("CREATE TABLE adatafilter (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, name varchar(255) not null, public bool not null," +
|
exec("CREATE TABLE adatafilter (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, name varchar(255) not null, public bool not null," +
|
||||||
"listkey varchar(255) not null, filter text, sort text, UNIQUE(name))");
|
"listkey varchar(255) not null, filter text, sort text, UNIQUE(name))");
|
||||||
|
setSchemaLevel(++currentSchema);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////
|
||||||
|
// TAGS repository
|
||||||
|
if (currentSchema < 9)
|
||||||
|
{
|
||||||
|
LogUpdateMessage(log);
|
||||||
|
exec("CREATE TABLE atag (id BIGSERIAL PRIMARY KEY, name varchar(255) not null, refcount bigint not null, UNIQUE(name))");
|
||||||
setSchemaLevel(++currentSchema);
|
setSchemaLevel(++currentSchema);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -291,6 +291,7 @@ namespace AyaNova.Util
|
|||||||
EraseTable("adatafilter", conn);
|
EraseTable("adatafilter", conn);
|
||||||
EraseTable("asearchkey", conn);
|
EraseTable("asearchkey", conn);
|
||||||
EraseTable("asearchdictionary", conn);
|
EraseTable("asearchdictionary", conn);
|
||||||
|
EraseTable("atag", conn);
|
||||||
|
|
||||||
conn.Close();
|
conn.Close();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user