This commit is contained in:
2018-12-05 21:18:51 +00:00
parent 517dcac7dd
commit 277ed7f1ed
3 changed files with 4 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ https://www.databasesoup.com/2015/01/tag-all-things.html
https://www.npgsql.org/efcore/mapping/array.html
https://www.postgresql.org/docs/current/arrays.html
2018-12-05 Research showed that actually I'm doing tags all wrong and the multi table method is not correct performance wise or simplicity wise
The winning method in a test using postgres was a text array of tags with a "gin" index see databasesoup link above.

View File

@@ -24,6 +24,7 @@ namespace AyaNova.Models
public DateTime? EndDate { get; set; }
public string Notes { get; set; }
public int Count {get;set;}
public List<string> Tags { get; set; }
}

View File

@@ -22,7 +22,7 @@ namespace AyaNova.Util
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::PrepareDatabaseForSeeding WHEN NEW TABLES ADDED!!!!
private const int DESIRED_SCHEMA_LEVEL = 9;
internal const long EXPECTED_COLUMN_COUNT = 107;
internal const long EXPECTED_COLUMN_COUNT = 108;
internal const long EXPECTED_INDEX_COUNT = 24;
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::PrepareDatabaseForSeeding WHEN NEW TABLES ADDED!!!!
@@ -205,7 +205,7 @@ namespace AyaNova.Util
//Add widget table
//id, text, longtext, boolean, currency,
exec("CREATE TABLE awidget (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, name varchar(255) not null, serial bigint not null," +
"startdate timestamp, enddate timestamp, dollaramount decimal(19,5), active bool, roles int4, count integer, notes text)");
"startdate timestamp, enddate timestamp, dollaramount decimal(19,5), active bool, roles int4, count integer, notes text, tags varchar(255) ARRAY)");
//TEST TEST TEST ONLY FOR DEVELOPMENT TESTING TO ENSURE UNIQUENESS
//exec("CREATE UNIQUE INDEX awidget_serial_idx ON awidget (serial);");