From da4c1118a7e484c754831cfa56106441174d071b Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 22 Dec 2022 00:57:43 +0000 Subject: [PATCH] --- server/util/AySchema.cs | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/server/util/AySchema.cs b/server/util/AySchema.cs index 65a5efb..6e5c880 100644 --- a/server/util/AySchema.cs +++ b/server/util/AySchema.cs @@ -22,16 +22,16 @@ namespace Sockeye.Util //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!! private const int DESIRED_SCHEMA_LEVEL = 16; - internal const long EXPECTED_COLUMN_COUNT = 385; - internal const long EXPECTED_INDEX_COUNT = 63; - internal const long EXPECTED_CHECK_CONSTRAINTS = 193; - internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 26; + internal const long EXPECTED_COLUMN_COUNT = 500; + internal const long EXPECTED_INDEX_COUNT = 71; + internal const long EXPECTED_CHECK_CONSTRAINTS = 234; + internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 34; internal const long EXPECTED_VIEWS = 0; internal const long EXPECTED_ROUTINES = 2; //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!! - ///////////////////////////////////////// (C385:I63:CC193:FC26:V0:R2) + ///////////////////////////////////////// (C500:I71:CC234:FC34:V0:R2) /* @@ -705,6 +705,11 @@ BEGIN when 68 then return format('DataListColumnView %L', ayobjectid); when 84 then aytkey= 'CustomerNotifySubscription'; when 92 then aytable = 'aintegration'; + when 93 then aytable = 'alicense'; + when 94 then aytable = 'atriallicenserequest'; + when 95 then aytable = 'asubscriptionserver'; + when 96 then aytable = 'apurchase'; + when 97 then aytable = 'aproduct'; else RETURN returnstr; @@ -868,31 +873,31 @@ $BODY$ LANGUAGE PLPGSQL STABLE"); await ExecQueryAsync("CREATE TABLE alicense (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, created TIMESTAMPTZ NOT NULL, " + "customerid BIGINT NOT NULL REFERENCES acustomer(id), regto TEXT NOT NULL, key TEXT NOT NULL, fetchcode TEXT, fetchemail TEXT, " - + "fetchedon TIMESTAMPTZ, fetched BOOL default false, dbid TEXT, licenseexpire TIMESTAMPZ, maintenanceexpire TIMESTAMPZ NOT NULL, " + + "fetchedon TIMESTAMPTZ, fetched BOOL default false, dbid TEXT, licenseexpire TIMESTAMPTZ, maintenanceexpire TIMESTAMPTZ NOT NULL, " + "wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY, toid BIGINT NOT NULL REFERENCES auser(id) )"); await ExecQueryAsync("CREATE TABLE atriallicenserequest (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, dbid TEXT NOT NULL, companyname TEXT NOT NULL, " + "contactname TEXT NOT NULL, email TEXT NOT NULL, emailconfirmcode TEXT NOT NULL, emailvalidated BOOL DEFAULT false, " + "requested TIMESTAMPTZ, processed TIMESTAMPTZ, status INTEGER NOT NULL DEFAULT 0, rejectreason TEXT, key TEXT, " - + "fetched TIMESTAMPZ, perpetual BOOL DEFAULT false NOT NULL )"); + + "fetched TIMESTAMPTZ, perpetual BOOL DEFAULT false NOT NULL )"); await ExecQueryAsync("CREATE TABLE asubscriptionserver (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, active BOOL NOT NULL DEFAULT true, created TIMESTAMPTZ NOT NULL, " - + "datacenter TEXT NOT NULL, timezone TEXT NOT NULL, lastupdated TIMESTAMPTZ, subscriptionexpire TIMESTAMPZ NOT NULL, " - + "trialexpire TIMESTAMPZ, trialcontact TEXT, trialemail TEXT, trialcompany TEXT, operatingsystem TEXT,ourdomain TEXT, customsubdomain TEXT, " + + "datacenter TEXT NOT NULL, timezone TEXT NOT NULL, lastupdated TIMESTAMPTZ, subscriptionexpire TIMESTAMPTZ NOT NULL, " + + "trialexpire TIMESTAMPTZ, trialcontact TEXT, trialemail TEXT, trialcompany TEXT, operatingsystem TEXT,ourdomain TEXT, customsubdomain TEXT, " + "wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY, licenseid BIGINT REFERENCES alicense(id), customerid BIGINT REFERENCES acustomer(id) )"); await ExecQueryAsync("CREATE TABLE aproduct (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL, active BOOL NOT NULL DEFAULT true, " - + "vendorid BIGINT NOT NULL REFERENCES avendor(id), TEXT NOT NULL, vendorcode TEXT NOT NULL, ourcode TEXT NOT NULL, " + + "vendorid BIGINT NOT NULL REFERENCES avendor(id), licenseinterval INTERVAL, maintinterval INTERVAL, vendorcode TEXT NOT NULL, ourcode TEXT NOT NULL, " + "wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY )"); await ExecQueryAsync("CREATE TABLE apurchase (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, customerid BIGINT NOT NULL REFERENCES acustomer(id) ON DELETE CASCADE, " + "vendorid BIGINT NOT NULL REFERENCES avendor(id), productid BIGINT NOT NULL REFERENCES aproduct(id), salesordernumber TEXT, " - + "purchasedate TIMESTAMPTZ NOT NULL, expiredate TIMESTAMPZ, canceldate TIMESTAMPZ, couponcode text, purchasenotes text, " - + "renewnoticesent BOOL NOT NULL DEFAULT false, quantity NOT NULL INTEGER DEFAULT 1, " + + "purchasedate TIMESTAMPTZ NOT NULL, expiredate TIMESTAMPTZ, canceldate TIMESTAMPTZ, couponcode text, purchasenotes text, " + + "renewnoticesent BOOL NOT NULL DEFAULT false, quantity INTEGER NOT NULL DEFAULT 1, " + "vendordata TEXT, processeddate TIMESTAMPTZ, " + "wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY )");