This commit is contained in:
2020-12-02 18:29:18 +00:00
parent 2f900f44ac
commit 4b9f303f86
4 changed files with 246 additions and 6 deletions

View File

@@ -22,7 +22,7 @@ namespace AyaNova.Util
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
private const int DESIRED_SCHEMA_LEVEL = 15;
internal const long EXPECTED_COLUMN_COUNT = 456;
internal const long EXPECTED_COLUMN_COUNT = 478;
internal const long EXPECTED_INDEX_COUNT = 145;
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
@@ -508,7 +508,12 @@ $BODY$;
//HEADOFFICE
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 )");
"notes text, wiki text, customfields text, tags varchar(255) ARRAY," +
"webaddress text, accountnumber text, usesbanking bool, contractexpires timestamp null, contractid bigint null references acontract(id), " +
"phone1 text, phone2 text, phone3 text, phone4 text, phone5 text, emailaddress text, " +
"postaddress text, postcity text, postregion text, postcountry text, postcode text, address text, city text, region text, country text, latitude decimal(8,6), longitude decimal(9,6)" +
" )");
await ExecQueryAsync("CREATE UNIQUE INDEX aheadoffice_name_id_idx ON aheadoffice (id, name);");
await ExecQueryAsync("CREATE INDEX aheadoffice_tags ON aheadoffice using GIN(tags)");
await ExecQueryAsync("ALTER TABLE acustomer add column headofficeid bigint null references aheadoffice");