This commit is contained in:
2020-08-26 17:20:31 +00:00
parent 387ede6924
commit fc24607c5b
6 changed files with 79 additions and 5 deletions

2
.vscode/launch.json vendored
View File

@@ -52,7 +52,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\\PostgreSQLPortable_12.0\\App\\PgSQL\\bin\\"

View File

@@ -0,0 +1,13 @@
namespace AyaNova.Biz
{
/// <summary>
/// All AyaNova report rendering types
/// </summary>
public enum ReportRenderType : int
{// rendertype(type to render, default is pdf, but could be text, csv etc),
PDF = 0,
Text = 1,
CSV = 2,
HTML = 3
}
}//eons

View File

@@ -69,6 +69,7 @@ namespace AyaNova.Models
public virtual DbSet<Logo> Logo { get; set; }
public virtual DbSet<Report> Report { get; set; }
//Note: had to add this constructor to work with the code in startup.cs that gets the connection string from the appsettings.json file
//and commented out the above on configuring

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using AyaNova.Biz;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
namespace AyaNova.Models
{
public class Report
{
public long Id { get; set; }
public uint Concurrency { get; set; }
[Required]
public string Name { get; set; }
public bool Active { get; set; }
public string Notes { get; set; }
public AuthorizationRoles Roles { get; set; }
[Required]
public AyaType ObjectType { get; set; }
public string Template { get; set; }
public string Style { get; set; }
public string JsPrerender { get; set; }
public string JsHelpers { get; set; }
[Required]
public ReportRenderType RenderType { get; set; }
//tentative in case of need
// public string Locale { get; set; }
// public string Header { get; set; }
// public string Footer { get; set; }
public Report()
{
RenderType = ReportRenderType.PDF;
ObjectType = AyaType.NoType;
Roles = AuthorizationRoles.All;
Active = true;
}
}//eoc
}//eons

View File

@@ -20,10 +20,10 @@ 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 = 13;
private const int DESIRED_SCHEMA_LEVEL = 14;
internal const long EXPECTED_COLUMN_COUNT = 390;
internal const long EXPECTED_INDEX_COUNT = 140;
internal const long EXPECTED_COLUMN_COUNT = 401;
internal const long EXPECTED_INDEX_COUNT = 142;
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
@@ -717,7 +717,15 @@ $BODY$;
await SetSchemaLevelAsync(++currentSchema);
}
//////////////////////////////////////////////////
// REPORT table
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, " +
"notes text, roles integer not null, objecttype integer not null, template text, style text, jsprerender text, jshelpers text, rendertype integer not null )");
await SetSchemaLevelAsync(++currentSchema);
}

View File

@@ -268,6 +268,11 @@ namespace AyaNova.Util
{
await conn.OpenAsync();
//### DELIBERATELY IGNORED
//Some data is deliberately not deleted for now:
//Reports
//Logos
//Delete from user options table first
using (var cmd = new Npgsql.NpgsqlCommand())
{