This commit is contained in:
2020-07-09 19:09:54 +00:00
parent 05f76723e4
commit 4e29788355
4 changed files with 85 additions and 21 deletions

View File

@@ -20,7 +20,7 @@ namespace AyaNova.Util
/////////// CHANGE THIS ON NEW SCHEMA UPDATE ////////////////////
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
private const int DESIRED_SCHEMA_LEVEL = 11;
private const int DESIRED_SCHEMA_LEVEL = 12;
internal const long EXPECTED_COLUMN_COUNT = 328;
internal const long EXPECTED_INDEX_COUNT = 134;
@@ -674,22 +674,28 @@ $BODY$;
// //////////////////////////////////////////////////
// // WikiPage table
// if (currentSchema < 11)
// {
// LogUpdateMessage(log);
//////////////////////////////////////////////////
// NOTIFICATIONS tables
if (currentSchema < 12)
{
LogUpdateMessage(log);
// await ExecQueryAsync("CREATE TABLE awikipage (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, " +
// "objectid bigint not null, objecttype integer not null, " +
// "content text)");
await ExecQueryAsync("CREATE TABLE anotifysubscription (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, " +
"subscriberid bigint, subscriberayatype integer, ayatype integer, eventtype integer not null, advancenotice interval, " +
"idvalue integer, deliverymethod integer not null, deliveryaddress text, attachreportid bigint, intags varchar(255) ARRAY NULL, outtags varchar(255) ARRAY NULL)");
// //INDEX: Most selective first as there is more unique ID's than unique types
// //to take advantage of this always query with where objectid=xx and objecttype=yy order
// await ExecQueryAsync("CREATE INDEX awikipage_typeid_idx ON awikipage (objectid, objecttype );");
// await SetSchemaLevelAsync(++currentSchema);
// }
await ExecQueryAsync("CREATE TABLE anotifyevent (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, created timestamp not null, " +
"ayatype integer, objectid bigint, eventtype integer not null, eventdate timestamp, savedmessage text");
//created (timestamp used to clean out old stuck events), ayatype, objectid, eventtype, appliestouserid (single subscriber event), aEventDate, ASAVEDMESSAGE, HASH?
//INDEX: Most selective first as there is more unique ID's than unique types
//to take advantage of this always query with where objectid=xx and objecttype=yy order
// await ExecQueryAsync("CREATE INDEX awikipage_typeid_idx ON awikipage (objectid, objecttype );");
await SetSchemaLevelAsync(++currentSchema);
}