From 010aa165742e40d9a775a0b1d4614fa088577334 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 10 Nov 2020 19:30:50 +0000 Subject: [PATCH] --- server/AyaNova/biz/ContractBiz.cs | 4 +- server/AyaNova/biz/CustomerBiz.cs | 4 +- server/AyaNova/biz/DataListViewBiz.cs | 5 +- server/AyaNova/biz/HeadOfficeBiz.cs | 4 +- server/AyaNova/biz/LoanUnitBiz.cs | 5 +- server/AyaNova/biz/NotifySubscriptionBiz.cs | 3 -- server/AyaNova/biz/PMBiz.cs | 4 +- server/AyaNova/biz/PMTemplateBiz.cs | 5 +- server/AyaNova/biz/PartBiz.cs | 4 +- server/AyaNova/biz/ProjectBiz.cs | 4 +- server/AyaNova/biz/PurchaseOrderBiz.cs | 3 -- server/AyaNova/biz/QuoteBiz.cs | 5 +- server/AyaNova/biz/QuoteTemplateBiz.cs | 4 +- server/AyaNova/biz/ReportBiz.cs | 4 +- server/AyaNova/biz/TranslationBiz.cs | 4 +- server/AyaNova/biz/UnitBiz.cs | 3 -- server/AyaNova/biz/UnitModelBiz.cs | 4 +- server/AyaNova/biz/UserBiz.cs | 3 -- server/AyaNova/biz/VendorBiz.cs | 5 +- server/AyaNova/biz/WidgetBiz.cs | 4 -- server/AyaNova/biz/WorkOrderBiz.cs | 3 -- server/AyaNova/biz/WorkorderTemplateBiz.cs | 4 -- server/AyaNova/models/Customer.cs | 53 +++++++++++++++++++++ server/AyaNova/util/AySchema.cs | 52 ++++++++++---------- 24 files changed, 94 insertions(+), 99 deletions(-) diff --git a/server/AyaNova/biz/ContractBiz.cs b/server/AyaNova/biz/ContractBiz.cs index c9dd1135..2ec36558 100644 --- a/server/AyaNova/biz/ContractBiz.cs +++ b/server/AyaNova/biz/ContractBiz.cs @@ -207,9 +207,7 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (proposedObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); + //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) diff --git a/server/AyaNova/biz/CustomerBiz.cs b/server/AyaNova/biz/CustomerBiz.cs index b82289ca..298c41d3 100644 --- a/server/AyaNova/biz/CustomerBiz.cs +++ b/server/AyaNova/biz/CustomerBiz.cs @@ -207,9 +207,7 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (proposedObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); + //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) diff --git a/server/AyaNova/biz/DataListViewBiz.cs b/server/AyaNova/biz/DataListViewBiz.cs index 0c970bda..ca33e63d 100644 --- a/server/AyaNova/biz/DataListViewBiz.cs +++ b/server/AyaNova/biz/DataListViewBiz.cs @@ -233,10 +233,7 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(inObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (inObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); - + //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) { diff --git a/server/AyaNova/biz/HeadOfficeBiz.cs b/server/AyaNova/biz/HeadOfficeBiz.cs index edb1e0d9..23385065 100644 --- a/server/AyaNova/biz/HeadOfficeBiz.cs +++ b/server/AyaNova/biz/HeadOfficeBiz.cs @@ -207,9 +207,7 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (proposedObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); + //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) diff --git a/server/AyaNova/biz/LoanUnitBiz.cs b/server/AyaNova/biz/LoanUnitBiz.cs index 42319de5..3e6b62cb 100644 --- a/server/AyaNova/biz/LoanUnitBiz.cs +++ b/server/AyaNova/biz/LoanUnitBiz.cs @@ -207,10 +207,7 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (proposedObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); - + //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) { diff --git a/server/AyaNova/biz/NotifySubscriptionBiz.cs b/server/AyaNova/biz/NotifySubscriptionBiz.cs index ec69186e..86a73501 100644 --- a/server/AyaNova/biz/NotifySubscriptionBiz.cs +++ b/server/AyaNova/biz/NotifySubscriptionBiz.cs @@ -237,9 +237,6 @@ namespace AyaNova.Biz // if (string.IsNullOrWhiteSpace(proposedObj.Name)) // AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - // //Name must be less than 255 characters - // if (proposedObj.Name.Length > 255) - // AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); // //If name is otherwise OK, check that name is unique // if (!PropertyHasErrors("Name")) diff --git a/server/AyaNova/biz/PMBiz.cs b/server/AyaNova/biz/PMBiz.cs index 4b22c502..73d21501 100644 --- a/server/AyaNova/biz/PMBiz.cs +++ b/server/AyaNova/biz/PMBiz.cs @@ -257,9 +257,7 @@ namespace AyaNova.Biz // if (string.IsNullOrWhiteSpace(proposedObj.Name)) // AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - // //Name must be less than 255 characters - // if (proposedObj.Name.Length > 255) - // AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); + // //If name is otherwise OK, check that name is unique // if (!PropertyHasErrors("Name")) diff --git a/server/AyaNova/biz/PMTemplateBiz.cs b/server/AyaNova/biz/PMTemplateBiz.cs index 05cbe000..9f78259f 100644 --- a/server/AyaNova/biz/PMTemplateBiz.cs +++ b/server/AyaNova/biz/PMTemplateBiz.cs @@ -222,10 +222,7 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (proposedObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); - + //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) { diff --git a/server/AyaNova/biz/PartBiz.cs b/server/AyaNova/biz/PartBiz.cs index 62ade33d..8ba89af2 100644 --- a/server/AyaNova/biz/PartBiz.cs +++ b/server/AyaNova/biz/PartBiz.cs @@ -207,9 +207,7 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (proposedObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); + //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) diff --git a/server/AyaNova/biz/ProjectBiz.cs b/server/AyaNova/biz/ProjectBiz.cs index 259fd720..6e3e7e73 100644 --- a/server/AyaNova/biz/ProjectBiz.cs +++ b/server/AyaNova/biz/ProjectBiz.cs @@ -207,9 +207,7 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (proposedObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); + //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) diff --git a/server/AyaNova/biz/PurchaseOrderBiz.cs b/server/AyaNova/biz/PurchaseOrderBiz.cs index 99f73cd8..d7ec289b 100644 --- a/server/AyaNova/biz/PurchaseOrderBiz.cs +++ b/server/AyaNova/biz/PurchaseOrderBiz.cs @@ -205,9 +205,6 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (proposedObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) diff --git a/server/AyaNova/biz/QuoteBiz.cs b/server/AyaNova/biz/QuoteBiz.cs index 88ac13c6..94d7af94 100644 --- a/server/AyaNova/biz/QuoteBiz.cs +++ b/server/AyaNova/biz/QuoteBiz.cs @@ -264,10 +264,7 @@ namespace AyaNova.Biz // if (string.IsNullOrWhiteSpace(proposedObj.Name)) // AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - // //Name must be less than 255 characters - // if (proposedObj.Name.Length > 255) - // AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); - + // //If name is otherwise OK, check that name is unique // if (!PropertyHasErrors("Name")) // { diff --git a/server/AyaNova/biz/QuoteTemplateBiz.cs b/server/AyaNova/biz/QuoteTemplateBiz.cs index 6e85e658..8fb867ae 100644 --- a/server/AyaNova/biz/QuoteTemplateBiz.cs +++ b/server/AyaNova/biz/QuoteTemplateBiz.cs @@ -240,9 +240,7 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (proposedObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); + //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) diff --git a/server/AyaNova/biz/ReportBiz.cs b/server/AyaNova/biz/ReportBiz.cs index fb081efa..737a2275 100644 --- a/server/AyaNova/biz/ReportBiz.cs +++ b/server/AyaNova/biz/ReportBiz.cs @@ -282,9 +282,7 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (proposedObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); + //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) diff --git a/server/AyaNova/biz/TranslationBiz.cs b/server/AyaNova/biz/TranslationBiz.cs index dc52f345..a405fb9f 100644 --- a/server/AyaNova/biz/TranslationBiz.cs +++ b/server/AyaNova/biz/TranslationBiz.cs @@ -354,9 +354,7 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (proposedObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 char max"); + //Name must be unique if (await ct.Translation.AnyAsync(z => z.Name == proposedObj.Name && z.Id != proposedObj.Id)) diff --git a/server/AyaNova/biz/UnitBiz.cs b/server/AyaNova/biz/UnitBiz.cs index 023e9dba..dd69c5f8 100644 --- a/server/AyaNova/biz/UnitBiz.cs +++ b/server/AyaNova/biz/UnitBiz.cs @@ -205,9 +205,6 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (proposedObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) diff --git a/server/AyaNova/biz/UnitModelBiz.cs b/server/AyaNova/biz/UnitModelBiz.cs index 5cbf7bba..2411ad84 100644 --- a/server/AyaNova/biz/UnitModelBiz.cs +++ b/server/AyaNova/biz/UnitModelBiz.cs @@ -205,9 +205,7 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (proposedObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); + //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) diff --git a/server/AyaNova/biz/UserBiz.cs b/server/AyaNova/biz/UserBiz.cs index 0161a5b9..00b0a471 100644 --- a/server/AyaNova/biz/UserBiz.cs +++ b/server/AyaNova/biz/UserBiz.cs @@ -423,9 +423,6 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (proposedObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) diff --git a/server/AyaNova/biz/VendorBiz.cs b/server/AyaNova/biz/VendorBiz.cs index 8efa1623..842dd31b 100644 --- a/server/AyaNova/biz/VendorBiz.cs +++ b/server/AyaNova/biz/VendorBiz.cs @@ -205,10 +205,7 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (proposedObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); - + //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) { diff --git a/server/AyaNova/biz/WidgetBiz.cs b/server/AyaNova/biz/WidgetBiz.cs index 5366b214..a74a6ec2 100644 --- a/server/AyaNova/biz/WidgetBiz.cs +++ b/server/AyaNova/biz/WidgetBiz.cs @@ -234,10 +234,6 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (proposedObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); - //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) { diff --git a/server/AyaNova/biz/WorkOrderBiz.cs b/server/AyaNova/biz/WorkOrderBiz.cs index 46add214..820dd653 100644 --- a/server/AyaNova/biz/WorkOrderBiz.cs +++ b/server/AyaNova/biz/WorkOrderBiz.cs @@ -342,9 +342,6 @@ namespace AyaNova.Biz // if (string.IsNullOrWhiteSpace(proposedObj.Name)) // AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - // //Name must be less than 255 characters - // if (proposedObj.Name.Length > 255) - // AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); // //If name is otherwise OK, check that name is unique // if (!PropertyHasErrors("Name")) diff --git a/server/AyaNova/biz/WorkorderTemplateBiz.cs b/server/AyaNova/biz/WorkorderTemplateBiz.cs index 856c7ce6..3fc68a70 100644 --- a/server/AyaNova/biz/WorkorderTemplateBiz.cs +++ b/server/AyaNova/biz/WorkorderTemplateBiz.cs @@ -242,10 +242,6 @@ namespace AyaNova.Biz if (string.IsNullOrWhiteSpace(proposedObj.Name)) AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); - //Name must be less than 255 characters - if (proposedObj.Name.Length > 255) - AddError(ApiErrorCode.VALIDATION_LENGTH_EXCEEDED, "Name", "255 max"); - //If name is otherwise OK, check that name is unique if (!PropertyHasErrors("Name")) { diff --git a/server/AyaNova/models/Customer.cs b/server/AyaNova/models/Customer.cs index dad8de97..3b12c289 100644 --- a/server/AyaNova/models/Customer.cs +++ b/server/AyaNova/models/Customer.cs @@ -24,9 +24,18 @@ namespace AyaNova.Models public List Tags { get; set; } + [Url] + public string WebAddress { get; set; } + public string PopUpNotes { get; set; } + public bool BillHeadOffice { get; set; } + public long HeadOfficeID { get; set; } + public string TechNotes { get; set; } + + public Customer() { Tags = new List(); + BillHeadOffice = false; } [NotMapped, JsonIgnore] @@ -35,3 +44,47 @@ namespace AyaNova.Models }//eoc }//eons +/* +[AID] [uniqueidentifier] NOT NULL, + [ANAME] [nvarchar](255) NOT NULL, + [ACREATED] [datetime] NULL, + [AMODIFIED] [datetime] NULL, + [AACTIVE] [bit] NOT NULL, + [ACREATOR] [uniqueidentifier] NULL, + [AMODIFIER] [uniqueidentifier] NULL, + [ADISPATCHZONEID] [uniqueidentifier] NULL, + [AWEBADDRESS] [nvarchar](255) NULL, + [APOPUPNOTES] [ntext] NULL, + [ACLIENTGROUPID] [uniqueidentifier] NULL, + [ABILLHEADOFFICE] [bit] NOT NULL, + [AHEADOFFICEID] [uniqueidentifier] NULL, + [ANOTES] [ntext] NULL, + [AREGIONID] [uniqueidentifier] NULL, + [ATECHNOTES] [ntext] NULL, + [AACCOUNTNUMBER] [nvarchar](255) NULL, + [ACUSTOM1] [ntext] NULL, + [ACUSTOM2] [ntext] NULL, + [ACUSTOM3] [ntext] NULL, + [ACUSTOM4] [ntext] NULL, + [ACUSTOM5] [ntext] NULL, + [ACUSTOM6] [ntext] NULL, + [ACUSTOM7] [ntext] NULL, + [ACUSTOM8] [ntext] NULL, + [ACUSTOM9] [ntext] NULL, + [ACUSTOM0] [ntext] NULL, + [AUSESBANKING] [bit] NOT NULL, + [ACONTRACTID] [uniqueidentifier] NULL, + [ACONTRACTEXPIRES] [datetime] NULL, + [ALASTWORKORDERID] [uniqueidentifier] NULL, + [ALASTSERVICEDATE] [datetime] NULL, + [ADEFAULTSERVICETEMPLATEID] [uniqueidentifier] NULL, + [ACONTACTNOTES] [ntext] NULL, + [ACONTACT] [nvarchar](500) NULL, + [APHONE1] [nvarchar](255) NULL, + [APHONE2] [nvarchar](255) NULL, + [APHONE3] [nvarchar](255) NULL, + [APHONE4] [nvarchar](255) NULL, + [APHONE5] [nvarchar](255) NULL, + [AEMAIL] [nvarchar](255) NULL, + [ASENDNOTIFICATIONS] [bit] NOT NULL, +*/ \ No newline at end of file diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index f9b9dfb7..3e528c4a 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -316,7 +316,7 @@ $BODY$; "); //create translation text tables - await ExecQueryAsync("CREATE TABLE atranslation (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null, stock bool, cjkindex bool default false)"); + await ExecQueryAsync("CREATE TABLE atranslation (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null, stock bool, cjkindex bool default false)"); await ExecQueryAsync("CREATE TABLE atranslationitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, translationid bigint not null REFERENCES atranslation (id), key text not null, display text not null)"); //This is not a well used index, not sure what it's point is @@ -327,7 +327,7 @@ $BODY$; //Add user table - await ExecQueryAsync("CREATE TABLE auser (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, active bool not null, name varchar(255) not null unique, " + + await ExecQueryAsync("CREATE TABLE auser (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, active bool not null, name text not null unique, " + "lastlogin timestamp, login text not null unique, password text not null, salt text not null, roles integer not null, currentauthtoken text, " + "dlkey text, dlkeyexpire timestamp, usertype integer not null, employeenumber varchar(255), notes text, customerid bigint, " + "headofficeid bigint, subvendorid bigint, wiki text, customfields text, tags varchar(255) ARRAY)"); @@ -369,7 +369,7 @@ $BODY$; //Add widget table //id, text, longtext, boolean, currency, - await ExecQueryAsync("CREATE TABLE awidget (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, serial bigint generated by default as identity not null," + + await ExecQueryAsync("CREATE TABLE awidget (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, serial bigint generated by default as identity not null," + "startdate timestamp, enddate timestamp, dollaramount decimal(19,4), active bool, usertype int4, count integer," + "notes text, userid bigint, wiki text, customfields text, tags varchar(255) ARRAY)"); @@ -431,7 +431,7 @@ $BODY$; { LogUpdateMessage(log); - await ExecQueryAsync("CREATE TABLE adatalistview (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, userid bigint not null, name varchar(255) not null unique, public bool not null," + + await ExecQueryAsync("CREATE TABLE adatalistview (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, userid bigint not null, name text not null unique, public bool not null," + "listkey varchar(255) not null, listview text)"); await SetSchemaLevelAsync(++currentSchema); @@ -443,7 +443,7 @@ $BODY$; if (currentSchema < 8) { LogUpdateMessage(log); - await ExecQueryAsync("CREATE TABLE atag (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, refcount bigint not null)"); + await ExecQueryAsync("CREATE TABLE atag (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, refcount bigint not null)"); await SetSchemaLevelAsync(++currentSchema); } @@ -482,61 +482,61 @@ $BODY$; LogUpdateMessage(log); //CUSTOMER - await ExecQueryAsync("CREATE TABLE acustomer (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, active bool, " + + 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)"); await ExecQueryAsync("CREATE UNIQUE INDEX acustomer_name_id_idx ON acustomer (id, name);"); await ExecQueryAsync("CREATE INDEX acustomer_tags ON acustomer using GIN(tags)"); //CONTRACT - await ExecQueryAsync("CREATE TABLE acontract (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE acontract (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 )"); await ExecQueryAsync("CREATE UNIQUE INDEX acontract_name_id_idx ON acontract (id, name);"); await ExecQueryAsync("CREATE INDEX acontract_tags ON acontract using GIN(tags)"); //HEADOFFICE - await ExecQueryAsync("CREATE TABLE aheadoffice (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE aheadoffice (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 )"); await ExecQueryAsync("CREATE UNIQUE INDEX aheadoffice_name_id_idx ON aheadoffice (id, name);"); await ExecQueryAsync("CREATE INDEX aheadoffice_tags ON aheadoffice using GIN(tags)"); //LOANUNIT - await ExecQueryAsync("CREATE TABLE aloanunit (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE aloanunit (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 )"); await ExecQueryAsync("CREATE UNIQUE INDEX aloanunit_name_id_idx ON aloanunit (id, name);"); await ExecQueryAsync("CREATE INDEX aloanunit_tags ON aloanunit using GIN(tags)"); //PART - await ExecQueryAsync("CREATE TABLE apart (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE apart (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 )"); await ExecQueryAsync("CREATE UNIQUE INDEX apart_name_id_idx ON apart (id, name);"); await ExecQueryAsync("CREATE INDEX apart_tags ON apart using GIN(tags)"); //PROJECT - await ExecQueryAsync("CREATE TABLE aproject (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE aproject (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 )"); await ExecQueryAsync("CREATE UNIQUE INDEX aproject_name_id_idx ON aproject (id, name);"); await ExecQueryAsync("CREATE INDEX aproject_tags ON aproject using GIN(tags)"); //PURCHASEORDER - await ExecQueryAsync("CREATE TABLE apurchaseorder (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE apurchaseorder (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 )"); await ExecQueryAsync("CREATE UNIQUE INDEX apurchaseorder_name_id_idx ON apurchaseorder (id, name);"); await ExecQueryAsync("CREATE INDEX apurchaseorder_tags ON apurchaseorder using GIN(tags)"); //UNIT - await ExecQueryAsync("CREATE TABLE aunit (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE aunit (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 )"); await ExecQueryAsync("CREATE UNIQUE INDEX aunit_name_id_idx ON aunit (id, name);"); await ExecQueryAsync("CREATE INDEX aunit_tags ON aunit using GIN(tags)"); //UNITMODEL - await ExecQueryAsync("CREATE TABLE aunitmodel (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE aunitmodel (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 )"); await ExecQueryAsync("CREATE UNIQUE INDEX aunitmodel_name_id_idx ON aunitmodel (id, name);"); await ExecQueryAsync("CREATE INDEX aunitmodel_tags ON aunitmodel using GIN(tags)"); //VENDOR - await ExecQueryAsync("CREATE TABLE avendor (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE avendor (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 )"); await ExecQueryAsync("CREATE UNIQUE INDEX avendor_name_id_idx ON avendor (id, name);"); await ExecQueryAsync("CREATE INDEX avendor_tags ON avendor using GIN(tags)"); @@ -613,13 +613,13 @@ $BODY$; //WORKORDERTEMPLATE - await ExecQueryAsync("CREATE TABLE aworkordertemplate (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE aworkordertemplate (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 )"); await ExecQueryAsync("CREATE UNIQUE INDEX aworkordertemplate_name_id_idx ON aworkordertemplate (id, name);"); await ExecQueryAsync("CREATE INDEX aworkordertemplate_tags ON aworkordertemplate using GIN(tags)"); //WORKORDERTEMPLATEITEM - await ExecQueryAsync("CREATE TABLE aworkordertemplateitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE aworkordertemplateitem (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 )"); await ExecQueryAsync("CREATE UNIQUE INDEX aworkordertemplateitem_name_id_idx ON aworkordertemplateitem (id, name);"); await ExecQueryAsync("CREATE INDEX aworkordertemplateitem_tags ON aworkordertemplateitem using GIN(tags)"); @@ -631,19 +631,19 @@ $BODY$; await ExecQueryAsync("CREATE INDEX aquote_tags ON aquote using GIN(tags)"); //QUOTEITEM - await ExecQueryAsync("CREATE TABLE aquoteitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, quoteid bigint not null REFERENCES aquote (id), name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE aquoteitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, quoteid bigint not null REFERENCES aquote (id), name text not null unique, active bool, " + "notes text, wiki text, customfields text, tags varchar(255) ARRAY )"); await ExecQueryAsync("CREATE UNIQUE INDEX aquoteitem_name_id_idx ON aquoteitem (id, name);"); await ExecQueryAsync("CREATE INDEX aquoteitem_tags ON aquoteitem using GIN(tags)"); //QUOTETEMPLATE - await ExecQueryAsync("CREATE TABLE aquotetemplate (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE aquotetemplate (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 )"); await ExecQueryAsync("CREATE UNIQUE INDEX aquotetemplate_name_id_idx ON aquotetemplate (id, name);"); await ExecQueryAsync("CREATE INDEX aquotetemplate_tags ON aquotetemplate using GIN(tags)"); //QUOTETEMPLATEITEM - await ExecQueryAsync("CREATE TABLE aquotetemplateitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE aquotetemplateitem (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 )"); await ExecQueryAsync("CREATE UNIQUE INDEX aquotetemplateitem_name_id_idx ON aquotetemplateitem (id, name);"); await ExecQueryAsync("CREATE INDEX aquotetemplateitem_tags ON aquotetemplateitem using GIN(tags)"); @@ -655,19 +655,19 @@ $BODY$; await ExecQueryAsync("CREATE INDEX apm_tags ON apm using GIN(tags)"); //PMITEM - await ExecQueryAsync("CREATE TABLE apmitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, pmid bigint not null REFERENCES apm (id), name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE apmitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, pmid bigint not null REFERENCES apm (id), name text not null unique, active bool, " + "notes text, wiki text, customfields text, tags varchar(255) ARRAY )"); await ExecQueryAsync("CREATE UNIQUE INDEX apmitem_name_id_idx ON apmitem (id, name);"); await ExecQueryAsync("CREATE INDEX apmitem_tags ON apmitem using GIN(tags)"); //PMTEMPLATE - await ExecQueryAsync("CREATE TABLE apmtemplate (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE apmtemplate (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 )"); await ExecQueryAsync("CREATE UNIQUE INDEX apmtemplate_name_id_idx ON apmtemplate (id, name);"); await ExecQueryAsync("CREATE INDEX apmtemplate_tags ON apmtemplate using GIN(tags)"); //PMTEMPLATEITEM - await ExecQueryAsync("CREATE TABLE apmtemplateitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE apmtemplateitem (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 )"); await ExecQueryAsync("CREATE UNIQUE INDEX apmtemplateitem_name_id_idx ON apmtemplateitem (id, name);"); await ExecQueryAsync("CREATE INDEX apmtemplateitem_tags ON apmtemplateitem using GIN(tags)"); @@ -690,12 +690,12 @@ $BODY$; "deliveryaddress text, linkreportid bigint not null, tags varchar(255) ARRAY)"); await ExecQueryAsync("CREATE TABLE anotifyevent (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, created timestamp not null, " + - "ayatype integer not null, objectid bigint not null, name varchar(255) not null, eventtype integer not null, notifysubscriptionid bigint not null references anotifysubscription(id) on delete cascade, " + + "ayatype integer not null, objectid bigint not null, name text not null, eventtype integer not null, notifysubscriptionid bigint not null references anotifysubscription(id) on delete cascade, " + "userid bigint not null REFERENCES auser (id), idvalue bigint not null, decvalue decimal(19,4) not null, eventdate timestamp not null, message text)"); await ExecQueryAsync("CREATE TABLE anotification (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, userid bigint not null REFERENCES auser (id), " + - "created timestamp not null, ayatype integer not null, objectid bigint not null, name varchar(255) not null, eventtype integer not null, " + + "created timestamp not null, ayatype integer not null, objectid bigint not null, name text not null, eventtype integer not null, " + "notifysubscriptionid bigint not null references anotifysubscription(id) on delete cascade, message text, fetched bool not null)"); await ExecQueryAsync("CREATE TABLE anotifydeliverylog (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, processed timestamp not null, " + @@ -722,7 +722,7 @@ $BODY$; if (currentSchema < 14) { LogUpdateMessage(log); - await ExecQueryAsync("CREATE TABLE areport (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, active bool, " + + await ExecQueryAsync("CREATE TABLE areport (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, active bool, " + "notes text, roles integer not null, objecttype integer not null, template text, style text, jsprerender text, jshelpers text, rendertype integer not null, " + "headertemplate text, footertemplate text, displayheaderfooter bool, paperformat integer not null, landscape bool, marginoptionsbottom text, " + "marginoptionsleft text, marginoptionsright text, marginoptionstop text, pageranges text, prefercsspagesize bool, printbackground bool, scale decimal(19,4) )");