diff --git a/server/AyaNova/models/Reminder.cs b/server/AyaNova/models/Reminder.cs index 7713e7c4..b165afc5 100644 --- a/server/AyaNova/models/Reminder.cs +++ b/server/AyaNova/models/Reminder.cs @@ -17,7 +17,7 @@ namespace AyaNova.Models [Required] public string Name { get; set; } - public bool Active { get; set; }//USE AS COMPLETED FIELD IN UI BUT KEEP AS ACTIVE HERE + // public bool Active { get; set; } public string Notes { get; set; } public string Wiki { get; set; } public string CustomFields { get; set; } @@ -26,13 +26,20 @@ namespace AyaNova.Models [Required] public DateTime StartDate { get; set; } [Required] - public DateTime EndDate { get; set; } + public DateTime StopDate { get; set; } [Required] public long UserId { get; set; } + /* + Hexadecimal notation: #RGB[A] + R (red), G (green), B (blue), and A (alpha) are hexadecimal characters (0–9, A–F). A is optional. The three-digit notation (#RGB) is a shorter version of the six-digit form (#RRGGBB). For example, #f09 is the same color as #ff0099. Likewise, the four-digit RGB notation (#RGBA) is a shorter version of the eight-digit form (#RRGGBBAA). For example, #0f38 is the same color as #00ff3388. + */ + [MaxLength(12)] + public string Color { get; set; } public Reminder() { Tags = new List(); + Color = "#ffffff";//white / no color is the default } [NotMapped, JsonIgnore] diff --git a/server/AyaNova/models/Review.cs b/server/AyaNova/models/Review.cs index 81647d15..dd204c4f 100644 --- a/server/AyaNova/models/Review.cs +++ b/server/AyaNova/models/Review.cs @@ -17,7 +17,7 @@ namespace AyaNova.Models [Required] public string Name { get; set; } - // public bool Active { get; set; }//USE AS COMPLETED FIELD IN UI BUT KEEP AS ACTIVE HERE + // public bool Active { get; set; }//NOT USED public string Notes { get; set; } public string Wiki { get; set; } public string CustomFields { get; set; } diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index 083fdd0d..7d89fed0 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -39,7 +39,7 @@ namespace AyaNova.Util HOW TO INDEX - + https://www.postgresqltutorial.com/postgresql-indexes/postgresql-create-index/ AyaNova does a lot of name fetching so any tables that contain a lot of columns in addition to the name will benefit from a compound index on (id,name) Other indexes should be created with care and after a huge load and integration test periodically look for unused indexes and see how they are performing @@ -487,6 +487,28 @@ $BODY$; "sent timestamp not null, viewed bool default false, replied bool default false, fromid bigint not null REFERENCES auser(id), toid bigint not null REFERENCES auser(id) )"); await ExecQueryAsync("CREATE INDEX amemo_tags ON amemo using GIN(tags)"); + //REMINDER + await ExecQueryAsync("CREATE TABLE areminder (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null, " + + "notes text, wiki text, customfields text, tags varchar(255) ARRAY, " + + "startdate timestamp not null, stopdate timestamp not null, userid bigint not null references auser(id), color varchar(12) not null default '#ffffff')"); + + await ExecQueryAsync("CREATE INDEX areminder_userid_idx ON areminder (userid);"); + await ExecQueryAsync("CREATE INDEX areminder_startdate_idx ON areminder (startdate);"); + await ExecQueryAsync("CREATE INDEX areminder_stopdate_idx ON areminder (stopdate);"); + await ExecQueryAsync("CREATE INDEX areminder_tags ON areminder using GIN(tags)"); + + //REVIEW + await ExecQueryAsync("CREATE TABLE areview (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null, " + + "notes text, wiki text, customfields text, tags varchar(255) ARRAY, " + + "duedate timestamp not null, completeddate timestamp null, completionnotes text, userid bigint not null references auser(id), " + + "assignedbyuserid bigint not null references auser(id), objecttype integer not null, objectid bigint not null)"); + + await ExecQueryAsync("CREATE INDEX areview_typeid_idx ON areview (objectid, objecttype );"); + await ExecQueryAsync("CREATE INDEX areview_userid_idx ON areview (userid);"); + await ExecQueryAsync("CREATE INDEX areview_duedate_idx ON areview (duedate);"); + await ExecQueryAsync("CREATE INDEX areview_completeddate_idx ON areview (completeddate);"); + await ExecQueryAsync("CREATE INDEX areview_tags ON areview using GIN(tags)"); + //CUSTOMER await ExecQueryAsync("CREATE TABLE acustomer (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, active bool, " + "notes text, wiki text, customfields text, tags varchar(255) ARRAY, " +