Locale -> Translation

This commit is contained in:
2020-03-06 19:36:36 +00:00
parent 884c834b3d
commit a234b3531d
58 changed files with 540 additions and 569 deletions

View File

@@ -150,25 +150,25 @@ namespace AyaNova.Util
await ExecQueryAsync("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
await ExecQueryAsync("CREATE TABLE alocale (id BIGSERIAL PRIMARY KEY, name varchar(255) not null, stock bool, cjkindex bool default false)");
//create translation text tables
await ExecQueryAsync("CREATE TABLE atranslation (id BIGSERIAL PRIMARY KEY, name varchar(255) not null, stock bool, cjkindex bool default false)");
//LOOKAT: I don't think this is doing anything:
//exec("CREATE UNIQUE INDEX alocale_name_idx ON alocale (name)");
//exec("CREATE UNIQUE INDEX atranslation_name_idx ON atranslation (name)");
await ExecQueryAsync("CREATE TABLE alocaleitem (id BIGSERIAL PRIMARY KEY, localeid bigint not null REFERENCES alocale (id), key text not null, display text not null)");
await ExecQueryAsync("CREATE TABLE atranslationitem (id BIGSERIAL PRIMARY KEY, translationid bigint not null REFERENCES atranslation (id), key text not null, display text not null)");
//LOOKAT: this is for what exactly??
// exec("CREATE INDEX alocaleitem_localeid_key_idx ON alocaleitem (localeid,key)");
// exec("CREATE INDEX atranslationitem_translationid_key_idx ON atranslationitem (translationid,key)");
//This seems more appropriate
await ExecQueryAsync("CREATE INDEX alocaleitem_localeid_key_display_idx ON alocaleitem (localeid,key, display)");
await ExecQueryAsync("CREATE INDEX atranslationitem_translationid_key_display_idx ON atranslationitem (translationid,key, display)");
//Load the default LOCALES
await AyaNova.Biz.PrimeData.PrimeLocales();
//Load the default TRANSLATIONS
await AyaNova.Biz.PrimeData.PrimeTranslations();
//Add user table
await ExecQueryAsync("CREATE TABLE auser (id BIGSERIAL PRIMARY KEY, active bool not null, name varchar(255) not null unique, " +
"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, translationid bigint not null REFERENCES atranslation (id), " +
"dlkey text, dlkeyexpire timestamp, usertype integer not null, employeenumber varchar(255), notes text, customerid bigint, " +
"headofficeid bigint, subvendorid bigint, customfields text, tags varchar(255) ARRAY)");