This commit is contained in:
@@ -9,6 +9,8 @@ namespace AyaNova.Models
|
|||||||
public partial class AyContext : DbContext
|
public partial class AyContext : DbContext
|
||||||
{
|
{
|
||||||
public virtual DbSet<Event> Event { get; set; }
|
public virtual DbSet<Event> Event { get; set; }
|
||||||
|
public virtual DbSet<SearchDictionary> SearchDictionary { get; set; }
|
||||||
|
public virtual DbSet<SearchKey> SearchKey { get; set; }
|
||||||
public virtual DbSet<User> User { get; set; }
|
public virtual DbSet<User> User { get; set; }
|
||||||
public virtual DbSet<UserOptions> UserOptions { get; set; }
|
public virtual DbSet<UserOptions> UserOptions { get; set; }
|
||||||
public virtual DbSet<License> License { get; set; }
|
public virtual DbSet<License> License { get; set; }
|
||||||
|
|||||||
19
server/AyaNova/models/SearchDictionary.cs
Normal file
19
server/AyaNova/models/SearchDictionary.cs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using AyaNova.Biz;
|
||||||
|
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace AyaNova.Models
|
||||||
|
{
|
||||||
|
|
||||||
|
public partial class SearchDictionary
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
public uint ConcurrencyToken { get; set; }
|
||||||
|
|
||||||
|
[Required, MaxLength(255)]
|
||||||
|
public string Word { get; set; }//max 255 characters ascii set
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
25
server/AyaNova/models/SearchKey.cs
Normal file
25
server/AyaNova/models/SearchKey.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using AyaNova.Biz;
|
||||||
|
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace AyaNova.Models
|
||||||
|
{
|
||||||
|
|
||||||
|
public partial class SearchKey
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
public uint ConcurrencyToken { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
public long WordId { get; set; }
|
||||||
|
[Required]
|
||||||
|
public long ObjectId { get; set; }
|
||||||
|
[Required]
|
||||||
|
public AyaType ObjectType { get; set; }
|
||||||
|
public bool InName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,8 +22,8 @@ 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 = 90;
|
internal const long EXPECTED_COLUMN_COUNT = 97;
|
||||||
internal const long EXPECTED_INDEX_COUNT = 18;
|
internal const long EXPECTED_INDEX_COUNT = 20;
|
||||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::PrepareDatabaseForSeeding WHEN NEW TABLES ADDED!!!!
|
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::PrepareDatabaseForSeeding WHEN NEW TABLES ADDED!!!!
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
@@ -115,7 +115,8 @@ namespace AyaNova.Util
|
|||||||
//************* SCHEMA UPDATES ******************
|
//************* SCHEMA UPDATES ******************
|
||||||
|
|
||||||
//////////////////////////////////////////////////
|
//////////////////////////////////////////////////
|
||||||
// USER table locale text and default data
|
// FOUNDATIONAL TABLES
|
||||||
|
//
|
||||||
if (currentSchema < 2)
|
if (currentSchema < 2)
|
||||||
{
|
{
|
||||||
LogUpdateMessage(log);
|
LogUpdateMessage(log);
|
||||||
@@ -129,6 +130,15 @@ namespace AyaNova.Util
|
|||||||
// exec("CREATE INDEX ayid_idx ON aevent (ayid);");
|
// exec("CREATE INDEX ayid_idx ON aevent (ayid);");
|
||||||
// exec("CREATE INDEX aytype_idx ON aevent (aytype);");
|
// exec("CREATE INDEX aytype_idx ON aevent (aytype);");
|
||||||
|
|
||||||
|
//Add the search key and dictionary tables
|
||||||
|
//TODO: Indexes determined through load testing and experimentation
|
||||||
|
//Too many indexes or unnecessary ones would be bad because this table is hit on every save / update of an object and would slow those ops
|
||||||
|
//too little is bad if search takes a dogs age to find anything
|
||||||
|
|
||||||
|
exec("CREATE TABLE asearchdictionary (id BIGSERIAL PRIMARY KEY, word varchar(255) not null)");
|
||||||
|
// exec("CREATE UNIQUE INDEX tagname_idx ON atag (name);");
|
||||||
|
exec("CREATE TABLE asearchkey (id BIGSERIAL PRIMARY KEY, wordid bigint not null REFERENCES asearchdictionary (id), objectid bigint not null, objecttype integer not null, inname bool not null)");
|
||||||
|
|
||||||
//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)");
|
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)");
|
||||||
@@ -138,6 +148,9 @@ namespace AyaNova.Util
|
|||||||
//Load the default LOCALES
|
//Load the default LOCALES
|
||||||
AyaNova.Biz.PrimeData.PrimeLocales(ct);
|
AyaNova.Biz.PrimeData.PrimeLocales(ct);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Add user table
|
//Add user table
|
||||||
exec("CREATE TABLE auser (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, active bool not null, name varchar(255) not null, " +
|
exec("CREATE TABLE auser (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, active bool not null, name varchar(255) not null, " +
|
||||||
"login text not null, password text not null, salt text not null, roles integer not null, localeid bigint not null REFERENCES alocale (id), " +
|
"login text not null, password text not null, salt text not null, roles integer not null, localeid bigint not null REFERENCES alocale (id), " +
|
||||||
|
|||||||
Reference in New Issue
Block a user