This commit is contained in:
2020-11-23 18:17:39 +00:00
parent 5d2d3e93aa
commit dc7671cdc1
3 changed files with 18 additions and 9 deletions

2
.vscode/launch.json vendored
View File

@@ -53,7 +53,7 @@
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
"AYANOVA_SERVER_TEST_MODE": "false",
"AYANOVA_SERVER_TEST_MODE": "true",
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"

View File

@@ -1,33 +1,38 @@
using System;
using System.Collections.Generic;
using AyaNova.Biz;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using AyaNova.Biz;
using Newtonsoft.Json;
namespace AyaNova.Models
{
//NOTE: Any non required field (nullable in DB) sb nullable here, i.e. decimal? not decimal,
//otherwise the server will call it an invalid record if the field isn't sent from client
public class CustomerNote : ICoreBizObjectModel
{
public long Id { get; set; }
public uint Concurrency { get; set; }
public uint Concurrency { get; set; }
[Required]
public long UserId { get; set; }
[Required]
public DateTime NoteDate { get; set; }
public string Notes { get; set; }
public List<string> Tags { get; set; }
public CustomerNote()
{
NoteDate = DateTime.UtcNow;
Tags = new List<string>();
}
[NotMapped, JsonIgnore]
public AyaType AyaType { get => AyaType.CustomerNote; }
[JsonIgnore]//hide from being returned (as null anyway) with User object in routes
public User User { get; set; }
}//eoc
}//eons

View File

@@ -22,8 +22,8 @@ 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 = 450;
internal const long EXPECTED_INDEX_COUNT = 144;
internal const long EXPECTED_COLUMN_COUNT = 455;
internal const long EXPECTED_INDEX_COUNT = 145;
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
@@ -492,6 +492,10 @@ $BODY$;
await ExecQueryAsync("ALTER TABLE auser add FOREIGN KEY (customerid) REFERENCES acustomer(id)");
//CUSTOMER NOTES
await ExecQueryAsync("CREATE TABLE acustomernotes (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, " +
"userid bigint not null REFERENCES auser(id), startdate timestamp not null, notes text, tags varchar(255) ARRAY )");
//CONTRACT
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 )");