Files
jube-fork/Jube.Migrations/Baseline/AddEntityAnalysisModelTable.cs
Richard ChurchmanandGitHub a500c37e36 Merge pull request #88
Refactors startup and DI, implements a local LRU cache to reduce Redis load, introduces high-performance dictionaries, and optimizes Invoke routing for parallelism. Includes Redis and library upgrades, schema migrations, logging improvements, and overall code cleanup for better performance, readability, and maintainabilit
2025-10-29 16:09:20 +02:00

97 lines
4.8 KiB
C#

/* Copyright (C) 2022-present Jube Holdings Limited.
*
* This file is part of Jube™ software.
*
* Jube™ is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
* Jube™ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License along with Jube™. If not,
* see <https://www.gnu.org/licenses/>.
*/
using System;
using FluentMigrator;
namespace Jube.Migrations.Baseline
{
[Migration(20220429124949)]
public class AddEntityAnalysisModelTable : Migration
{
public override void Up()
{
Create.Table("EntityAnalysisModel")
.WithColumn("Id").AsInt32().PrimaryKey().Identity()
.WithColumn("Name").AsString().Nullable()
.WithColumn("Guid").AsGuid().Nullable()
.WithColumn("EntryXPath").AsString().Nullable()
.WithColumn("ReferenceDateXPath").AsString().Nullable()
.WithColumn("CreatedUser").AsString().Nullable()
.WithColumn("CreatedDate").AsDateTime2().Nullable()
.WithColumn("UpdatedDate").AsDateTime2().Nullable()
.WithColumn("UpdatedUser").AsString().Nullable()
.WithColumn("DeletedDate").AsDateTime2().Nullable()
.WithColumn("DeletedUser").AsString().Nullable()
.WithColumn("Active").AsByte().Nullable()
.WithColumn("Locked").AsByte().Nullable()
.WithColumn("Deleted").AsByte().Nullable()
.WithColumn("EntryName").AsString().Nullable()
.WithColumn("ReferenceDateName").AsString().Nullable()
.WithColumn("TenantRegistryId").AsInt32().Nullable()
.WithColumn("CacheFetchLimit").AsInt32().Nullable()
.WithColumn("ReferenceDatePayloadLocationTypeId").AsByte().Nullable()
.WithColumn("MaxResponseElevation").AsDouble().Nullable()
.WithColumn("MaxResponseElevationInterval").AsString().Nullable()
.WithColumn("MaxResponseElevationValue").AsInt32().Nullable()
.WithColumn("MaxResponseElevationThreshold").AsInt32().Nullable()
.WithColumn("MaxActivationWatcherInterval").AsString().Nullable()
.WithColumn("MaxActivationWatcherValue").AsInt32().Nullable()
.WithColumn("MaxActivationWatcherThreshold").AsInt32().Nullable()
.WithColumn("ActivationWatcherSample").AsDouble().Nullable()
.WithColumn("PromoteActivationArchive").AsByte().Nullable()
.WithColumn("EnableCache").AsByte().Nullable()
.WithColumn("EnableRdbmsArchive").AsByte().Nullable()
.WithColumn("EnableTtlCounter").AsByte().Nullable()
.WithColumn("EnableSanctionCache").AsByte().Nullable()
.WithColumn("EnableActivationArchive").AsByte().Nullable()
.WithColumn("Version").AsInt32().Nullable()
.WithColumn("EnableActivationWatcher").AsByte().Nullable()
.WithColumn("EnableResponseElevationLimit").AsByte().Nullable();
Insert.IntoTable("EntityAnalysisModel").Row(new
{
Name = "Detailed Account Financial Transactions",
Guid = Guid.Parse("90c425fd-101a-420b-91d1-cb7a24a969cc"),
CreatedDate = DateTime.Now,
EntryXPath = "$.TxnId",
EntryName = "TxnId",
ReferenceDateXPath = "$.TxnDateTime",
ReferenceDatePayloadLocationTypeId = 1,
CreatedUser = "Administrator",
Active = 1,
ReferenceDateName = "TxnDateTime",
TenantRegistryId = 1,
CacheFetchLimit = 100,
EnableCache = 1,
EnableRdbmsArchive = 1,
EnableTtlCounter = 1,
EnableSanctionCache = 1,
EnableActivationArchive = 1,
EnableActivationWatcher = 1,
MaxActivationWatcherValue = 1,
MaxActivationWatcherInterval = "h",
MaxActivationWatcherThreshold = 100,
EnableResponseElevationLimit = 0,
MaxResponseElevation = 10,
Version = 1,
ActivationWatcherSample = 1
});
}
public override void Down()
{
Delete.Table("EntityAnalysisModel");
}
}
}