diff --git a/devdocs/specs/core-customize-form-fields.txt b/devdocs/specs/core-customize-form-fields.txt index 9476c5fc..915cf378 100644 --- a/devdocs/specs/core-customize-form-fields.txt +++ b/devdocs/specs/core-customize-form-fields.txt @@ -35,14 +35,14 @@ UI FEATURE - The ability to customize forms: ## TODO - Need a FormCustom table and model to hold the user's form customization data - - Only holds items that differ from stock, no "core" fields allowed - - FormKey - - FieldKey - - Hide - - Required - - Type (checkbox, date, date time, decimal, number, picklist, and text) + - Like DataFilter, holds a JSON fragment in one field and the form key in another field + - JSON FRAGMENT holds items that differ from stock, no "core" fields allowed + - FieldKey + - Hide + - Required + - Type (checkbox, date, date time, decimal, number, picklist, and text) - - Need a FormAvailableFields static collection class that contains the fields available to each form + - #DONE# Need a FormAvailableFields static collection class that contains the fields available to each form - This should be independent from any other class tied to a particular route or controller or db table as it could be some or none of all of those things - Method: GetFields(FormKey): FieldKey (localekey), Hideable (bool), SharedLTKey (bool means it's not specific to that form), Custom (bool, means it's one of the custom fields that can be set to type etc) - Method: GetForms() returns a list of form names diff --git a/server/AyaNova/Startup.cs b/server/AyaNova/Startup.cs index b3c5e844..4be91b55 100644 --- a/server/AyaNova/Startup.cs +++ b/server/AyaNova/Startup.cs @@ -380,7 +380,7 @@ namespace AyaNova // ******************** TESTING WIPE DB ***************************** // //Set this to true to wipe the db and reinstall a trial license and re-seed the data - var TESTING_REFRESH_DB = false;//####################################################################################### + var TESTING_REFRESH_DB = true;//####################################################################################### #if (DEBUG) //TESTING diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index 133816e1..6354c7d0 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -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 = 9; + private const int DESIRED_SCHEMA_LEVEL = 10; internal const long EXPECTED_COLUMN_COUNT = 98; internal const long EXPECTED_INDEX_COUNT = 22; @@ -240,26 +240,6 @@ namespace AyaNova.Util } - // ////////////////////////////////////////////////// - // //TAG tables - // if (currentSchema < 6) - // { - // LogUpdateMessage(log); - // // LOOKAT: Should taggroupmap have an index that enforces no taggroup can have the same tag more than once? Same for objects being tagged? - // exec("CREATE TABLE atag (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, name varchar(255) not null)"); - - // //LOOKAT: isn't this useless without the ID? Need to see if it's being used after unit testing - // exec("CREATE UNIQUE INDEX atag_name_idx ON atag (name);"); - - // exec("CREATE TABLE atagmap (id BIGSERIAL PRIMARY KEY, ownerid bigint not null," + - // "tagid bigint not null REFERENCES atag (id), tagtoobjectid bigint not null, tagtoobjecttype integer not null)"); - - // //Taggroup - // exec("CREATE TABLE ataggroup (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, name varchar(255) not null)"); - // exec("CREATE TABLE ataggroupmap (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, tagid bigint not null REFERENCES atag (id), taggroupid bigint not null)"); - - // setSchemaLevel(++currentSchema); - // } ////////////////////////////////////////////////// @@ -317,6 +297,17 @@ namespace AyaNova.Util + ////////////////////////////////////////////////// + //FORMCUSTOM table + if (currentSchema < 10) + { + LogUpdateMessage(log); + + exec("CREATE TABLE aformcustom (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, " + + "formkey varchar(255) not null, template text, UNIQUE(formkey))"); + setSchemaLevel(++currentSchema); + } + //MAKE SURE THE DESIRED SCHEMA WAS SET PROPERLY if (currentSchema > DESIRED_SCHEMA_LEVEL) diff --git a/server/AyaNova/util/DbUtil.cs b/server/AyaNova/util/DbUtil.cs index 2418b0e8..254bf80f 100644 --- a/server/AyaNova/util/DbUtil.cs +++ b/server/AyaNova/util/DbUtil.cs @@ -289,6 +289,7 @@ namespace AyaNova.Util EraseTable("awidget", conn); EraseTable("aevent", conn); EraseTable("adatafilter", conn); + EraseTable("aformcustom", conn); EraseTable("asearchkey", conn); EraseTable("asearchdictionary", conn); EraseTable("atag", conn);