diff --git a/CHANGELOG.md b/CHANGELOG.md
index ddff77e3b..2b610a9b2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 1.7.1
+Release built: _not released yet_
+
+### Database changes
+- Added missing index on `validator_cumulative_emission_history`
+
## 1.7.0
Release built: _not released yet_
diff --git a/Directory.Build.props b/Directory.Build.props
index d33f40923..e0eba4bda 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -14,7 +14,7 @@
- 1.7.0
+ 1.7.1
develop
diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/CommonDbContext.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/CommonDbContext.cs
index e87d39462..667f62362 100644
--- a/src/RadixDlt.NetworkGateway.PostgresIntegration/CommonDbContext.cs
+++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/CommonDbContext.cs
@@ -615,6 +615,10 @@ private static void HookupHistory(ModelBuilder modelBuilder)
.Entity()
.HasIndex(e => new { e.ValidatorEntityId, e.EpochNumber });
+ modelBuilder
+ .Entity()
+ .HasIndex(e => new { e.ValidatorEntityId, e.FromStateVersion });
+
modelBuilder
.Entity()
.HasIndex(e => new { e.EntityId, e.FromStateVersion });
diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240827101440_AddValidatorCumulativeEmissionHistoryIdx.Designer.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240827101440_AddValidatorCumulativeEmissionHistoryIdx.Designer.cs
new file mode 100644
index 000000000..f3ebcb843
--- /dev/null
+++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240827101440_AddValidatorCumulativeEmissionHistoryIdx.Designer.cs
@@ -0,0 +1,2922 @@
+/* Copyright 2021 Radix Publishing Ltd incorporated in Jersey (Channel Islands).
+ *
+ * Licensed under the Radix License, Version 1.0 (the "License"); you may not use this
+ * file except in compliance with the License. You may obtain a copy of the License at:
+ *
+ * radixfoundation.org/licenses/LICENSE-v1
+ *
+ * The Licensor hereby grants permission for the Canonical version of the Work to be
+ * published, distributed and used under or by reference to the Licensor’s trademark
+ * Radix ® and use of any unregistered trade names, logos or get-up.
+ *
+ * The Licensor provides the Work (and each Contributor provides its Contributions) on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
+ * including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
+ * MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Whilst the Work is capable of being deployed, used and adopted (instantiated) to create
+ * a distributed ledger it is your responsibility to test and validate the code, together
+ * with all logic and performance of that code under all foreseeable scenarios.
+ *
+ * The Licensor does not make or purport to make and hereby excludes liability for all
+ * and any representation, warranty or undertaking in any form whatsoever, whether express
+ * or implied, to any entity or person, including any representation, warranty or
+ * undertaking, as to the functionality security use, value or other characteristics of
+ * any distributed ledger nor in respect the functioning or value of any tokens which may
+ * be created stored or transferred using the Work. The Licensor does not warrant that the
+ * Work or any use of the Work complies with any law or regulation in any territory where
+ * it may be implemented or used or that it will be appropriate for any specific purpose.
+ *
+ * Neither the licensor nor any current or former employees, officers, directors, partners,
+ * trustees, representatives, agents, advisors, contractors, or volunteers of the Licensor
+ * shall be liable for any direct or indirect, special, incidental, consequential or other
+ * losses of any kind, in tort, contract or otherwise (including but not limited to loss
+ * of revenue, income or profits, or loss of use or data, or loss of reputation, or loss
+ * of any economic or other opportunity of whatsoever nature or howsoever arising), arising
+ * out of or in connection with (without limitation of any use, misuse, of any ledger system
+ * or use made or its functionality or any performance or operation of any code or protocol
+ * caused by bugs or programming or logic errors or otherwise);
+ *
+ * A. any offer, purchase, holding, use, sale, exchange or transmission of any
+ * cryptographic keys, tokens or assets created, exchanged, stored or arising from any
+ * interaction with the Work;
+ *
+ * B. any failure in a transmission or loss of any token or assets keys or other digital
+ * artefacts due to errors in transmission;
+ *
+ * C. bugs, hacks, logic errors or faults in the Work or any communication;
+ *
+ * D. system software or apparatus including but not limited to losses caused by errors
+ * in holding or transmitting tokens by any third-party;
+ *
+ * E. breaches or failure of security including hacker attacks, loss or disclosure of
+ * password, loss of private key, unauthorised use or misuse of such passwords or keys;
+ *
+ * F. any losses including loss of anticipated savings or other benefits resulting from
+ * use of the Work or any changes to the Work (however implemented).
+ *
+ * You are solely responsible for; testing, validating and evaluation of all operation
+ * logic, functionality, security and appropriateness of using the Work for any commercial
+ * or non-commercial purpose and for any reproduction or redistribution by You of the
+ * Work. You assume all risks associated with Your use of the Work and the exercise of
+ * permissions under this License.
+ */
+
+//
+using System;
+using System.Collections.Generic;
+using System.Numerics;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using RadixDlt.NetworkGateway.Abstractions.Model;
+using RadixDlt.NetworkGateway.Abstractions.StandardMetadata;
+using RadixDlt.NetworkGateway.PostgresIntegration;
+using RadixDlt.NetworkGateway.PostgresIntegration.Models;
+
+#nullable disable
+
+namespace RadixDlt.NetworkGateway.PostgresIntegration.Migrations
+{
+ [DbContext(typeof(MigrationsDbContext))]
+ [Migration("20240827101440_AddValidatorCumulativeEmissionHistoryIdx")]
+ partial class AddValidatorCumulativeEmissionHistoryIdx
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.2")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "account_default_deposit_rule", new[] { "accept", "reject", "allow_existing" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "account_resource_preference_rule", new[] { "allowed", "disallowed" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "authorized_depositor_badge_type", new[] { "resource", "non_fungible" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_relationship", new[] { "component_to_instantiating_package", "vault_to_resource", "royalty_vault_of_component", "validator_to_stake_vault", "validator_to_pending_xrd_withdraw_vault", "validator_to_locked_owner_stake_unit_vault", "validator_to_pending_owner_stake_unit_unlock_vault", "stake_unit_of_validator", "claim_token_of_validator", "account_locker_of_locker", "account_locker_of_account", "resource_pool_to_unit_resource", "resource_pool_to_resource", "resource_pool_to_resource_vault", "unit_resource_of_resource_pool", "resource_vault_of_resource_pool", "access_controller_to_recovery_badge", "recovery_badge_of_access_controller" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "global_consensus_manager", "global_fungible_resource", "global_non_fungible_resource", "global_generic_component", "internal_generic_component", "global_account_component", "global_package", "internal_key_value_store", "internal_fungible_vault", "internal_non_fungible_vault", "global_validator", "global_access_controller", "global_identity", "global_one_resource_pool", "global_two_resource_pool", "global_multi_resource_pool", "global_transaction_tracker", "global_account_locker" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "ledger_transaction_manifest_class", new[] { "general", "transfer", "validator_stake", "validator_unstake", "validator_claim", "account_deposit_settings_update", "pool_contribution", "pool_redemption" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "ledger_transaction_marker_event_type", new[] { "withdrawal", "deposit" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "ledger_transaction_marker_operation_type", new[] { "resource_in_use", "account_deposited_into", "account_withdrawn_from", "account_owner_method_call", "badge_presented" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "ledger_transaction_marker_origin_type", new[] { "user", "epoch_change" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "ledger_transaction_marker_type", new[] { "origin", "event", "manifest_address", "affected_global_entity", "manifest_class", "event_global_emitter" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "ledger_transaction_status", new[] { "succeeded", "failed" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "ledger_transaction_type", new[] { "genesis", "user", "round_update", "flash" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "module_id", new[] { "main", "metadata", "royalty", "role_assignment" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "non_fungible_id_type", new[] { "string", "integer", "bytes", "ruid" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "package_vm_type", new[] { "native", "scrypto_v1" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "pending_transaction_intent_ledger_status", new[] { "unknown", "committed", "commit_pending", "permanent_rejection", "possible_to_commit", "likely_but_not_certain_rejection" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "pending_transaction_payload_ledger_status", new[] { "unknown", "committed", "commit_pending", "clashing_commit", "permanently_rejected", "transiently_accepted", "transiently_rejected" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "public_key_type", new[] { "ecdsa_secp256k1", "eddsa_ed25519" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "resource_type", new[] { "fungible", "non_fungible" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "sbor_type_kind", new[] { "well_known", "schema_local" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "standard_metadata_key", new[] { "dapp_account_type", "dapp_definition", "dapp_definitions", "dapp_claimed_websites", "dapp_claimed_entities", "dapp_account_locker" });
+ NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "state_type", new[] { "json", "sbor" });
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.AccountAuthorizedDepositorAggregateHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AccountEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("account_entity_id");
+
+ b.Property>("EntryIds")
+ .IsRequired()
+ .HasColumnType("bigint[]")
+ .HasColumnName("entry_ids");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AccountEntityId", "FromStateVersion");
+
+ b.ToTable("account_authorized_depositor_aggregate_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.AccountAuthorizedDepositorEntryHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AccountEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("account_entity_id");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean")
+ .HasColumnName("is_deleted");
+
+ b.Property("discriminator")
+ .HasColumnType("authorized_depositor_badge_type");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AccountEntityId", "FromStateVersion");
+
+ b.ToTable("account_authorized_depositor_entry_history");
+
+ b.HasDiscriminator("discriminator");
+
+ b.UseTphMappingStrategy();
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.AccountDefaultDepositRuleHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AccountEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("account_entity_id");
+
+ b.Property("DefaultDepositRule")
+ .HasColumnType("account_default_deposit_rule")
+ .HasColumnName("default_deposit_rule");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AccountEntityId", "FromStateVersion");
+
+ b.ToTable("account_default_deposit_rule_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.AccountLockerEntryDefinition", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AccountEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("account_entity_id");
+
+ b.Property("AccountLockerEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("account_locker_entity_id");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("KeyValueStoreEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("key_value_store_entity_id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AccountLockerEntityId", "AccountEntityId")
+ .IsUnique();
+
+ b.ToTable("account_locker_entry_definition");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.AccountLockerEntryResourceVaultDefinition", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AccountLockerDefinitionId")
+ .HasColumnType("bigint")
+ .HasColumnName("account_locker_definition_id");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("ResourceEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("resource_entity_id");
+
+ b.Property("VaultEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("vault_entity_id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AccountLockerDefinitionId", "FromStateVersion")
+ .IsUnique();
+
+ b.ToTable("account_locker_entry_resource_vault_definition");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.AccountLockerEntryTouchHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AccountLockerDefinitionId")
+ .HasColumnType("bigint")
+ .HasColumnName("account_locker_definition_id");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AccountLockerDefinitionId", "FromStateVersion");
+
+ b.ToTable("account_locker_entry_touch_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.AccountResourcePreferenceRuleAggregateHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AccountEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("account_entity_id");
+
+ b.Property>("EntryIds")
+ .IsRequired()
+ .HasColumnType("bigint[]")
+ .HasColumnName("entry_ids");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AccountEntityId", "FromStateVersion");
+
+ b.ToTable("account_resource_preference_rule_aggregate_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.AccountResourcePreferenceRuleEntryHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AccountEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("account_entity_id");
+
+ b.Property("AccountResourcePreferenceRule")
+ .HasColumnType("account_resource_preference_rule")
+ .HasColumnName("account_resource_preference_rule");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean")
+ .HasColumnName("is_deleted");
+
+ b.Property("ResourceEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("resource_entity_id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AccountEntityId", "ResourceEntityId", "FromStateVersion");
+
+ b.ToTable("account_resource_preference_rule_entry_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.ComponentMethodRoyaltyAggregateHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("EntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("entity_id");
+
+ b.Property>("EntryIds")
+ .IsRequired()
+ .HasColumnType("bigint[]")
+ .HasColumnName("entry_ids");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EntityId", "FromStateVersion");
+
+ b.ToTable("component_method_royalty_aggregate_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.ComponentMethodRoyaltyEntryHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("EntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("entity_id");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("IsLocked")
+ .HasColumnType("boolean")
+ .HasColumnName("is_locked");
+
+ b.Property("MethodName")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("method_name");
+
+ b.Property("RoyaltyAmount")
+ .HasColumnType("jsonb")
+ .HasColumnName("royalty_amount");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EntityId", "FromStateVersion");
+
+ b.HasIndex("EntityId", "MethodName", "FromStateVersion");
+
+ b.ToTable("component_method_royalty_entry_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.Entity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Address")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("address");
+
+ b.Property>("AncestorIds")
+ .HasColumnType("bigint[]")
+ .HasColumnName("ancestor_ids");
+
+ b.Property>("CorrelatedEntityIds")
+ .IsRequired()
+ .HasColumnType("bigint[]")
+ .HasColumnName("correlated_entity_ids");
+
+ b.Property>("CorrelatedEntityRelationships")
+ .IsRequired()
+ .HasColumnType("entity_relationship[]")
+ .HasColumnName("correlated_entity_relationships");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("GlobalAncestorId")
+ .HasColumnType("bigint")
+ .HasColumnName("global_ancestor_id");
+
+ b.Property("IsGlobal")
+ .HasColumnType("boolean")
+ .HasColumnName("is_global");
+
+ b.Property("OwnerAncestorId")
+ .HasColumnType("bigint")
+ .HasColumnName("owner_ancestor_id");
+
+ b.Property("ParentAncestorId")
+ .HasColumnType("bigint")
+ .HasColumnName("parent_ancestor_id");
+
+ b.Property("discriminator")
+ .HasColumnType("entity_type");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Address")
+ .IsUnique();
+
+ b.HasIndex("FromStateVersion")
+ .HasFilter("discriminator = 'global_validator'");
+
+ b.ToTable("entities");
+
+ b.HasDiscriminator("discriminator");
+
+ b.UseTphMappingStrategy();
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.EntityMetadataAggregateHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("EntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("entity_id");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property>("MetadataIds")
+ .IsRequired()
+ .HasColumnType("bigint[]")
+ .HasColumnName("metadata_ids");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EntityId", "FromStateVersion");
+
+ b.ToTable("entity_metadata_aggregate_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.EntityMetadataHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("EntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("entity_id");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean")
+ .HasColumnName("is_deleted");
+
+ b.Property("IsLocked")
+ .HasColumnType("boolean")
+ .HasColumnName("is_locked");
+
+ b.Property("Key")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("key");
+
+ b.Property("Value")
+ .HasColumnType("bytea")
+ .HasColumnName("value");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EntityId", "Key", "FromStateVersion");
+
+ b.ToTable("entity_metadata_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.EntityResourceAggregateHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("EntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("entity_id");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property>("FungibleResourceEntityIds")
+ .IsRequired()
+ .HasColumnType("bigint[]")
+ .HasColumnName("fungible_resource_entity_ids");
+
+ b.Property>("FungibleResourceSignificantUpdateStateVersions")
+ .IsRequired()
+ .HasColumnType("bigint[]")
+ .HasColumnName("fungible_resource_significant_update_state_versions");
+
+ b.Property>("NonFungibleResourceEntityIds")
+ .IsRequired()
+ .HasColumnType("bigint[]")
+ .HasColumnName("non_fungible_resource_entity_ids");
+
+ b.Property>("NonFungibleResourceSignificantUpdateStateVersions")
+ .IsRequired()
+ .HasColumnType("bigint[]")
+ .HasColumnName("non_fungible_resource_significant_update_state_versions");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EntityId", "FromStateVersion");
+
+ b.ToTable("entity_resource_aggregate_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.EntityResourceAggregatedVaultsHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("EntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("entity_id");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("ResourceEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("resource_entity_id");
+
+ b.Property("discriminator")
+ .HasColumnType("resource_type");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EntityId", "ResourceEntityId", "FromStateVersion");
+
+ b.ToTable("entity_resource_aggregated_vaults_history");
+
+ b.HasDiscriminator("discriminator");
+
+ b.UseTphMappingStrategy();
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.EntityResourceVaultAggregateHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("EntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("entity_id");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("ResourceEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("resource_entity_id");
+
+ b.Property>("VaultEntityIds")
+ .IsRequired()
+ .HasColumnType("bigint[]")
+ .HasColumnName("vault_entity_ids");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EntityId", "ResourceEntityId", "FromStateVersion");
+
+ b.ToTable("entity_resource_vault_aggregate_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.EntityRoleAssignmentsAggregateHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("EntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("entity_id");
+
+ b.Property>("EntryIds")
+ .IsRequired()
+ .HasColumnType("bigint[]")
+ .HasColumnName("entry_ids");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("OwnerRoleId")
+ .HasColumnType("bigint")
+ .HasColumnName("owner_role_id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EntityId", "FromStateVersion");
+
+ b.ToTable("entity_role_assignments_aggregate_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.EntityRoleAssignmentsEntryHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("EntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("entity_id");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean")
+ .HasColumnName("is_deleted");
+
+ b.Property("KeyModule")
+ .HasColumnType("module_id")
+ .HasColumnName("key_module");
+
+ b.Property("KeyRole")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("key_role");
+
+ b.Property("RoleAssignments")
+ .HasColumnType("jsonb")
+ .HasColumnName("role_assignments");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EntityId", "KeyRole", "KeyModule", "FromStateVersion");
+
+ b.ToTable("entity_role_assignments_entry_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.EntityRoleAssignmentsOwnerRoleHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("EntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("entity_id");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("RoleAssignments")
+ .IsRequired()
+ .HasColumnType("jsonb")
+ .HasColumnName("role_assignments");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EntityId", "FromStateVersion");
+
+ b.ToTable("entity_role_assignments_owner_role_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.EntityVaultHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("GlobalEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("global_entity_id");
+
+ b.Property("OwnerEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("owner_entity_id");
+
+ b.Property("ResourceEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("resource_entity_id");
+
+ b.Property("VaultEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("vault_entity_id");
+
+ b.Property("discriminator")
+ .HasColumnType("resource_type");
+
+ b.HasKey("Id");
+
+ b.HasIndex("GlobalEntityId", "FromStateVersion")
+ .HasFilter("is_royalty_vault = true");
+
+ b.HasIndex("OwnerEntityId", "FromStateVersion")
+ .HasFilter("is_royalty_vault = true");
+
+ b.HasIndex("VaultEntityId", "FromStateVersion");
+
+ b.HasIndex("GlobalEntityId", "VaultEntityId", "FromStateVersion");
+
+ b.HasIndex("Id", "ResourceEntityId", "FromStateVersion");
+
+ b.HasIndex("OwnerEntityId", "VaultEntityId", "FromStateVersion");
+
+ b.ToTable("entity_vault_history");
+
+ b.HasDiscriminator("discriminator");
+
+ b.UseTphMappingStrategy();
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.KeyValueStoreEntryDefinition", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("Key")
+ .IsRequired()
+ .HasColumnType("bytea")
+ .HasColumnName("key");
+
+ b.Property("KeyValueStoreEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("key_value_store_entity_id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("KeyValueStoreEntityId", "FromStateVersion");
+
+ b.HasIndex("KeyValueStoreEntityId", "Key")
+ .HasDatabaseName("IX_key_value_store_entry_definition_key_value_store_entity_id~1");
+
+ b.ToTable("key_value_store_entry_definition");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.KeyValueStoreEntryHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean")
+ .HasColumnName("is_deleted");
+
+ b.Property("IsLocked")
+ .HasColumnType("boolean")
+ .HasColumnName("is_locked");
+
+ b.Property("KeyValueStoreEntryDefinitionId")
+ .HasColumnType("bigint")
+ .HasColumnName("key_value_store_entry_definition_id");
+
+ b.Property("Value")
+ .HasColumnType("bytea")
+ .HasColumnName("value");
+
+ b.HasKey("Id");
+
+ b.HasIndex("KeyValueStoreEntryDefinitionId", "FromStateVersion");
+
+ b.ToTable("key_value_store_entry_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.KeyValueStoreSchemaHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("KeySborTypeKind")
+ .HasColumnType("sbor_type_kind")
+ .HasColumnName("key_sbor_type_kind");
+
+ b.Property("KeySchemaDefiningEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("key_schema_defining_entity_id");
+
+ b.Property("KeySchemaHash")
+ .IsRequired()
+ .HasColumnType("bytea")
+ .HasColumnName("key_schema_hash");
+
+ b.Property("KeyTypeIndex")
+ .HasColumnType("bigint")
+ .HasColumnName("key_type_index");
+
+ b.Property("KeyValueStoreEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("key_value_store_entity_id");
+
+ b.Property("ValueSborTypeKind")
+ .HasColumnType("sbor_type_kind")
+ .HasColumnName("value_sbor_type_kind");
+
+ b.Property("ValueSchemaDefiningEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("value_schema_defining_entity_id");
+
+ b.Property("ValueSchemaHash")
+ .IsRequired()
+ .HasColumnType("bytea")
+ .HasColumnName("value_schema_hash");
+
+ b.Property("ValueTypeIndex")
+ .HasColumnType("bigint")
+ .HasColumnName("value_type_index");
+
+ b.HasKey("Id");
+
+ b.HasIndex("KeyValueStoreEntityId", "FromStateVersion");
+
+ b.ToTable("key_value_store_schema_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.LedgerTransaction", b =>
+ {
+ b.Property("StateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("state_version");
+
+ b.Property("AffectedGlobalEntities")
+ .IsRequired()
+ .HasColumnType("bigint[]")
+ .HasColumnName("affected_global_entities");
+
+ b.Property("BalanceChanges")
+ .HasColumnType("jsonb")
+ .HasColumnName("balance_changes");
+
+ b.Property("CreatedTimestamp")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_timestamp");
+
+ b.Property("Epoch")
+ .HasColumnType("bigint")
+ .HasColumnName("epoch");
+
+ b.Property("FeePaid")
+ .HasPrecision(1000)
+ .HasColumnType("numeric")
+ .HasColumnName("fee_paid");
+
+ b.Property("IndexInEpoch")
+ .HasColumnType("bigint")
+ .HasColumnName("index_in_epoch");
+
+ b.Property("IndexInRound")
+ .HasColumnType("bigint")
+ .HasColumnName("index_in_round");
+
+ b.Property("NormalizedRoundTimestamp")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("normalized_round_timestamp");
+
+ b.Property("ReceiptCostingParameters")
+ .IsRequired()
+ .HasColumnType("jsonb")
+ .HasColumnName("receipt_costing_parameters");
+
+ b.Property("ReceiptErrorMessage")
+ .HasColumnType("text")
+ .HasColumnName("receipt_error_message");
+
+ b.Property("ReceiptEventEmitters")
+ .IsRequired()
+ .HasColumnType("jsonb[]")
+ .HasColumnName("receipt_event_emitters");
+
+ b.Property("ReceiptEventNames")
+ .IsRequired()
+ .HasColumnType("text[]")
+ .HasColumnName("receipt_event_names");
+
+ b.Property("ReceiptEventSborTypeKinds")
+ .IsRequired()
+ .HasColumnType("sbor_type_kind[]")
+ .HasColumnName("receipt_event_sbor_type_kinds");
+
+ b.Property("ReceiptEventSbors")
+ .IsRequired()
+ .HasColumnType("bytea[]")
+ .HasColumnName("receipt_event_sbors");
+
+ b.Property("ReceiptEventSchemaEntityIds")
+ .IsRequired()
+ .HasColumnType("bigint[]")
+ .HasColumnName("receipt_event_schema_entity_ids");
+
+ b.Property("ReceiptEventSchemaHashes")
+ .IsRequired()
+ .HasColumnType("bytea[]")
+ .HasColumnName("receipt_event_schema_hashes");
+
+ b.Property("ReceiptEventTypeIndexes")
+ .IsRequired()
+ .HasColumnType("bigint[]")
+ .HasColumnName("receipt_event_type_indexes");
+
+ b.Property("ReceiptFeeDestination")
+ .HasColumnType("jsonb")
+ .HasColumnName("receipt_fee_destination");
+
+ b.Property("ReceiptFeeSource")
+ .HasColumnType("jsonb")
+ .HasColumnName("receipt_fee_source");
+
+ b.Property("ReceiptFeeSummary")
+ .IsRequired()
+ .HasColumnType("jsonb")
+ .HasColumnName("receipt_fee_summary");
+
+ b.Property("ReceiptNextEpoch")
+ .HasColumnType("jsonb")
+ .HasColumnName("receipt_next_epoch");
+
+ b.Property("ReceiptOutput")
+ .HasColumnType("jsonb")
+ .HasColumnName("receipt_output");
+
+ b.Property("ReceiptStateUpdates")
+ .IsRequired()
+ .HasColumnType("jsonb")
+ .HasColumnName("receipt_state_updates");
+
+ b.Property("ReceiptStatus")
+ .HasColumnType("ledger_transaction_status")
+ .HasColumnName("receipt_status");
+
+ b.Property("ReceiptTreeHash")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("receipt_tree_hash");
+
+ b.Property("RoundInEpoch")
+ .HasColumnType("bigint")
+ .HasColumnName("round_in_epoch");
+
+ b.Property("RoundTimestamp")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("round_timestamp");
+
+ b.Property("StateTreeHash")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("state_tree_hash");
+
+ b.Property("TipPaid")
+ .HasPrecision(1000)
+ .HasColumnType("numeric")
+ .HasColumnName("tip_paid");
+
+ b.Property("TransactionTreeHash")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("transaction_tree_hash");
+
+ b.Property("discriminator")
+ .HasColumnType("ledger_transaction_type");
+
+ b.HasKey("StateVersion");
+
+ b.HasIndex("RoundTimestamp");
+
+ b.HasIndex("Epoch", "RoundInEpoch")
+ .IsUnique()
+ .HasFilter("index_in_round = 0");
+
+ b.ToTable("ledger_transactions");
+
+ b.HasDiscriminator("discriminator");
+
+ b.UseTphMappingStrategy();
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.LedgerTransactionMarker", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("StateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("state_version");
+
+ b.Property("discriminator")
+ .HasColumnType("ledger_transaction_marker_type");
+
+ b.HasKey("Id");
+
+ b.HasIndex("StateVersion");
+
+ b.ToTable("ledger_transaction_markers");
+
+ b.HasDiscriminator("discriminator");
+
+ b.UseTphMappingStrategy();
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.NonFungibleIdDataHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Data")
+ .HasColumnType("bytea")
+ .HasColumnName("data");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean")
+ .HasColumnName("is_deleted");
+
+ b.Property("IsLocked")
+ .HasColumnType("boolean")
+ .HasColumnName("is_locked");
+
+ b.Property("NonFungibleIdDefinitionId")
+ .HasColumnType("bigint")
+ .HasColumnName("non_fungible_id_definition_id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NonFungibleIdDefinitionId", "FromStateVersion");
+
+ b.ToTable("non_fungible_id_data_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.NonFungibleIdDefinition", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("NonFungibleId")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("non_fungible_id");
+
+ b.Property("NonFungibleResourceEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("non_fungible_resource_entity_id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NonFungibleResourceEntityId", "FromStateVersion");
+
+ b.HasIndex("NonFungibleResourceEntityId", "NonFungibleId", "FromStateVersion")
+ .IsUnique()
+ .HasDatabaseName("IX_non_fungible_id_definition_non_fungible_resource_entity_id~1");
+
+ b.ToTable("non_fungible_id_definition");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.NonFungibleIdLocationHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("NonFungibleIdDataId")
+ .HasColumnType("bigint")
+ .HasColumnName("non_fungible_id_definition_id");
+
+ b.Property("VaultEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("vault_entity_id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NonFungibleIdDataId", "FromStateVersion");
+
+ b.ToTable("non_fungible_id_location_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.NonFungibleSchemaHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("ResourceEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("resource_entity_id");
+
+ b.Property("SborTypeKind")
+ .HasColumnType("sbor_type_kind")
+ .HasColumnName("sbor_type_kind");
+
+ b.Property("SchemaDefiningEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("schema_defining_entity_id");
+
+ b.Property("SchemaHash")
+ .IsRequired()
+ .HasColumnType("bytea")
+ .HasColumnName("schema_hash");
+
+ b.Property("TypeIndex")
+ .HasColumnType("bigint")
+ .HasColumnName("type_index");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ResourceEntityId", "FromStateVersion");
+
+ b.ToTable("non_fungible_schema_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.PackageBlueprintAggregateHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property>("PackageBlueprintIds")
+ .IsRequired()
+ .HasColumnType("bigint[]")
+ .HasColumnName("package_blueprint_ids");
+
+ b.Property("PackageEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("package_entity_id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("PackageEntityId", "FromStateVersion");
+
+ b.ToTable("package_blueprint_aggregate_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.PackageBlueprintHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AuthTemplate")
+ .HasColumnType("jsonb")
+ .HasColumnName("auth_template");
+
+ b.Property("AuthTemplateIsLocked")
+ .HasColumnType("boolean")
+ .HasColumnName("auth_template_is_locked");
+
+ b.Property("Definition")
+ .IsRequired()
+ .HasColumnType("jsonb")
+ .HasColumnName("definition");
+
+ b.Property>("DependantEntityIds")
+ .HasColumnType("bigint[]")
+ .HasColumnName("dependant_entity_ids");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("name");
+
+ b.Property("PackageEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("package_entity_id");
+
+ b.Property("RoyaltyConfig")
+ .HasColumnType("jsonb")
+ .HasColumnName("royalty_config");
+
+ b.Property("RoyaltyConfigIsLocked")
+ .HasColumnType("boolean")
+ .HasColumnName("royalty_config_is_locked");
+
+ b.Property("Version")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("version");
+
+ b.HasKey("Id");
+
+ b.HasIndex("PackageEntityId", "FromStateVersion");
+
+ b.HasIndex("PackageEntityId", "Name", "Version", "FromStateVersion");
+
+ b.ToTable("package_blueprint_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.PackageCodeAggregateHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property>("PackageCodeIds")
+ .IsRequired()
+ .HasColumnType("bigint[]")
+ .HasColumnName("package_code_ids");
+
+ b.Property("PackageEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("package_entity_id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("PackageEntityId", "FromStateVersion");
+
+ b.ToTable("package_code_aggregate_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.PackageCodeHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Code")
+ .IsRequired()
+ .HasColumnType("bytea")
+ .HasColumnName("code");
+
+ b.Property("CodeHash")
+ .IsRequired()
+ .HasColumnType("bytea")
+ .HasColumnName("code_hash");
+
+ b.Property("FromStateVersion")
+ .HasColumnType("bigint")
+ .HasColumnName("from_state_version");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean")
+ .HasColumnName("is_deleted");
+
+ b.Property("PackageEntityId")
+ .HasColumnType("bigint")
+ .HasColumnName("package_entity_id");
+
+ b.Property("VmType")
+ .HasColumnType("package_vm_type")
+ .HasColumnName("vm_type");
+
+ b.HasKey("Id");
+
+ b.HasIndex("PackageEntityId", "FromStateVersion");
+
+ b.ToTable("package_code_history");
+ });
+
+ modelBuilder.Entity("RadixDlt.NetworkGateway.PostgresIntegration.Models.PendingTransaction", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property