diff --git a/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml b/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml index c2b8e453c..2f7cce4ad 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml +++ b/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml @@ -2090,6 +2090,9 @@ components: $ref: "#/components/schemas/HexString" receipt: $ref: "#/components/schemas/TransactionReceipt" + manifest_instructions: + type: string + nullable: true message: type: object description: | @@ -2743,6 +2746,10 @@ components: description: if set to `true`, all affected global entities by given transaction are returned. type: boolean default: false + manifest_instructions: + description: if set to `true`, manifest instructions for user transactions are returned. + type: boolean + default: false balance_changes: description: | if set to `true`, returns the fungible and non-fungible balance changes. @@ -2860,7 +2867,6 @@ components: # /stream/* Request & Response Types # - # TODO PP: update docs with examples. StreamTransactionsRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/CommittedTransactionInfo.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/CommittedTransactionInfo.cs index 08fc7ae67..f162b674a 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/CommittedTransactionInfo.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/CommittedTransactionInfo.cs @@ -122,9 +122,10 @@ protected CommittedTransactionInfo() { } /// errorMessage. /// Hex-encoded binary blob.. /// receipt. + /// manifestInstructions. /// The optional transaction message. This type is defined in the Core API as `TransactionMessage`. See the Core API documentation for more details. . /// balanceChanges. - public CommittedTransactionInfo(long stateVersion = default(long), long epoch = default(long), long round = default(long), string roundTimestamp = default(string), TransactionStatus transactionStatus = default(TransactionStatus), string payloadHash = default(string), string intentHash = default(string), string feePaid = default(string), List affectedGlobalEntities = default(List), DateTime? confirmedAt = default(DateTime?), string errorMessage = default(string), string rawHex = default(string), TransactionReceipt receipt = default(TransactionReceipt), Object message = default(Object), TransactionBalanceChanges balanceChanges = default(TransactionBalanceChanges)) + public CommittedTransactionInfo(long stateVersion = default(long), long epoch = default(long), long round = default(long), string roundTimestamp = default(string), TransactionStatus transactionStatus = default(TransactionStatus), string payloadHash = default(string), string intentHash = default(string), string feePaid = default(string), List affectedGlobalEntities = default(List), DateTime? confirmedAt = default(DateTime?), string errorMessage = default(string), string rawHex = default(string), TransactionReceipt receipt = default(TransactionReceipt), string manifestInstructions = default(string), Object message = default(Object), TransactionBalanceChanges balanceChanges = default(TransactionBalanceChanges)) { this.StateVersion = stateVersion; this.Epoch = epoch; @@ -144,6 +145,7 @@ protected CommittedTransactionInfo() { } this.ErrorMessage = errorMessage; this.RawHex = rawHex; this.Receipt = receipt; + this.ManifestInstructions = manifestInstructions; this.Message = message; this.BalanceChanges = balanceChanges; } @@ -224,6 +226,12 @@ protected CommittedTransactionInfo() { } [DataMember(Name = "receipt", EmitDefaultValue = true)] public TransactionReceipt Receipt { get; set; } + /// + /// Gets or Sets ManifestInstructions + /// + [DataMember(Name = "manifest_instructions", EmitDefaultValue = true)] + public string ManifestInstructions { get; set; } + /// /// The optional transaction message. This type is defined in the Core API as `TransactionMessage`. See the Core API documentation for more details. /// @@ -258,6 +266,7 @@ public override string ToString() sb.Append(" ErrorMessage: ").Append(ErrorMessage).Append("\n"); sb.Append(" RawHex: ").Append(RawHex).Append("\n"); sb.Append(" Receipt: ").Append(Receipt).Append("\n"); + sb.Append(" ManifestInstructions: ").Append(ManifestInstructions).Append("\n"); sb.Append(" Message: ").Append(Message).Append("\n"); sb.Append(" BalanceChanges: ").Append(BalanceChanges).Append("\n"); sb.Append("}\n"); @@ -357,6 +366,11 @@ public bool Equals(CommittedTransactionInfo input) (this.Receipt != null && this.Receipt.Equals(input.Receipt)) ) && + ( + this.ManifestInstructions == input.ManifestInstructions || + (this.ManifestInstructions != null && + this.ManifestInstructions.Equals(input.ManifestInstructions)) + ) && ( this.Message == input.Message || (this.Message != null && @@ -418,6 +432,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.Receipt.GetHashCode(); } + if (this.ManifestInstructions != null) + { + hashCode = (hashCode * 59) + this.ManifestInstructions.GetHashCode(); + } if (this.Message != null) { hashCode = (hashCode * 59) + this.Message.GetHashCode(); diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsRequest.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsRequest.cs index dbd387b8c..400e90d39 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsRequest.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsRequest.cs @@ -111,7 +111,7 @@ protected StateEntityDetailsRequest() { } /// /// atLedgerState. /// optIns. - /// addresses (required). + /// limited to max 100 items. (required). /// aggregationLevel. public StateEntityDetailsRequest(LedgerStateSelector atLedgerState = default(LedgerStateSelector), StateEntityDetailsOptIns optIns = default(StateEntityDetailsOptIns), List addresses = default(List), ResourceAggregationLevel? aggregationLevel = default(ResourceAggregationLevel?)) { @@ -139,8 +139,9 @@ protected StateEntityDetailsRequest() { } public StateEntityDetailsOptIns OptIns { get; set; } /// - /// Gets or Sets Addresses + /// limited to max 100 items. /// + /// limited to max 100 items. [DataMember(Name = "addresses", IsRequired = true, EmitDefaultValue = true)] public List Addresses { get; set; } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsRequestAllOf.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsRequestAllOf.cs index 434bb6a57..3d8aca8d0 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsRequestAllOf.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsRequestAllOf.cs @@ -110,7 +110,7 @@ protected StateEntityDetailsRequestAllOf() { } /// Initializes a new instance of the class. /// /// optIns. - /// addresses (required). + /// limited to max 100 items. (required). /// aggregationLevel. public StateEntityDetailsRequestAllOf(StateEntityDetailsOptIns optIns = default(StateEntityDetailsOptIns), List addresses = default(List), ResourceAggregationLevel? aggregationLevel = default(ResourceAggregationLevel?)) { @@ -131,8 +131,9 @@ protected StateEntityDetailsRequestAllOf() { } public StateEntityDetailsOptIns OptIns { get; set; } /// - /// Gets or Sets Addresses + /// limited to max 100 items. /// + /// limited to max 100 items. [DataMember(Name = "addresses", IsRequired = true, EmitDefaultValue = true)] public List Addresses { get; set; } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateKeyValueStoreDataRequest.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateKeyValueStoreDataRequest.cs index ae982e5ce..3a2916655 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateKeyValueStoreDataRequest.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateKeyValueStoreDataRequest.cs @@ -105,7 +105,7 @@ protected StateKeyValueStoreDataRequest() { } /// /// atLedgerState. /// Bech32m-encoded human readable version of the address. (required). - /// keys (required). + /// limited to max 100 items. (required). public StateKeyValueStoreDataRequest(LedgerStateSelector atLedgerState = default(LedgerStateSelector), string keyValueStoreAddress = default(string), List keys = default(List)) { // to ensure "keyValueStoreAddress" is required (not null) @@ -137,8 +137,9 @@ protected StateKeyValueStoreDataRequest() { } public string KeyValueStoreAddress { get; set; } /// - /// Gets or Sets Keys + /// limited to max 100 items. /// + /// limited to max 100 items. [DataMember(Name = "keys", IsRequired = true, EmitDefaultValue = true)] public List Keys { get; set; } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateKeyValueStoreDataRequestAllOf.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateKeyValueStoreDataRequestAllOf.cs index ec4985dd5..52154ccbc 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateKeyValueStoreDataRequestAllOf.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateKeyValueStoreDataRequestAllOf.cs @@ -104,7 +104,7 @@ protected StateKeyValueStoreDataRequestAllOf() { } /// Initializes a new instance of the class. /// /// Bech32m-encoded human readable version of the address. (required). - /// keys (required). + /// limited to max 100 items. (required). public StateKeyValueStoreDataRequestAllOf(string keyValueStoreAddress = default(string), List keys = default(List)) { // to ensure "keyValueStoreAddress" is required (not null) @@ -129,8 +129,9 @@ protected StateKeyValueStoreDataRequestAllOf() { } public string KeyValueStoreAddress { get; set; } /// - /// Gets or Sets Keys + /// limited to max 100 items. /// + /// limited to max 100 items. [DataMember(Name = "keys", IsRequired = true, EmitDefaultValue = true)] public List Keys { get; set; } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateNonFungibleDataRequest.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateNonFungibleDataRequest.cs index 0cdaee9c3..742429608 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateNonFungibleDataRequest.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateNonFungibleDataRequest.cs @@ -105,7 +105,7 @@ protected StateNonFungibleDataRequest() { } /// /// atLedgerState. /// Bech32m-encoded human readable version of the address. (required). - /// nonFungibleIds (required). + /// limited to max 100 items. (required). public StateNonFungibleDataRequest(LedgerStateSelector atLedgerState = default(LedgerStateSelector), string resourceAddress = default(string), List nonFungibleIds = default(List)) { // to ensure "resourceAddress" is required (not null) @@ -137,8 +137,9 @@ protected StateNonFungibleDataRequest() { } public string ResourceAddress { get; set; } /// - /// Gets or Sets NonFungibleIds + /// limited to max 100 items. /// + /// limited to max 100 items. [DataMember(Name = "non_fungible_ids", IsRequired = true, EmitDefaultValue = true)] public List NonFungibleIds { get; set; } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateNonFungibleLocationRequest.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateNonFungibleLocationRequest.cs index 667fcb392..e8f32ed30 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateNonFungibleLocationRequest.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateNonFungibleLocationRequest.cs @@ -105,7 +105,7 @@ protected StateNonFungibleLocationRequest() { } /// /// atLedgerState. /// Bech32m-encoded human readable version of the address. (required). - /// nonFungibleIds (required). + /// limited to max 100 items. (required). public StateNonFungibleLocationRequest(LedgerStateSelector atLedgerState = default(LedgerStateSelector), string resourceAddress = default(string), List nonFungibleIds = default(List)) { // to ensure "resourceAddress" is required (not null) @@ -137,8 +137,9 @@ protected StateNonFungibleLocationRequest() { } public string ResourceAddress { get; set; } /// - /// Gets or Sets NonFungibleIds + /// limited to max 100 items. /// + /// limited to max 100 items. [DataMember(Name = "non_fungible_ids", IsRequired = true, EmitDefaultValue = true)] public List NonFungibleIds { get; set; } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateNonFungibleLocationRequestAllOf.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateNonFungibleLocationRequestAllOf.cs index 1bb995d93..f6fc4f043 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateNonFungibleLocationRequestAllOf.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateNonFungibleLocationRequestAllOf.cs @@ -104,7 +104,7 @@ protected StateNonFungibleLocationRequestAllOf() { } /// Initializes a new instance of the class. /// /// Bech32m-encoded human readable version of the address. (required). - /// nonFungibleIds (required). + /// limited to max 100 items. (required). public StateNonFungibleLocationRequestAllOf(string resourceAddress = default(string), List nonFungibleIds = default(List)) { // to ensure "resourceAddress" is required (not null) @@ -129,8 +129,9 @@ protected StateNonFungibleLocationRequestAllOf() { } public string ResourceAddress { get; set; } /// - /// Gets or Sets NonFungibleIds + /// limited to max 100 items. /// + /// limited to max 100 items. [DataMember(Name = "non_fungible_ids", IsRequired = true, EmitDefaultValue = true)] public List NonFungibleIds { get; set; } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/TransactionDetailsOptIns.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/TransactionDetailsOptIns.cs index fc405c6fa..91bc16cea 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/TransactionDetailsOptIns.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/TransactionDetailsOptIns.cs @@ -107,8 +107,9 @@ public partial class TransactionDetailsOptIns : IEquatableif set to `true`, events inside receipt object is returned. (default to false). /// (true by default) if set to `true`, transaction receipt output is returned. (default to true). /// if set to `true`, all affected global entities by given transaction are returned. (default to false). + /// if set to `true`, manifest instructions for user transactions are returned. (default to false). /// if set to `true`, returns the fungible and non-fungible balance changes. **Warning!** This opt-in might be missing for recently committed transactions, in that case a `null` value will be returned. Retry the request until non-null value is returned. (default to false). - public TransactionDetailsOptIns(bool rawHex = false, bool receiptStateChanges = false, bool receiptFeeSummary = false, bool receiptFeeSource = false, bool receiptFeeDestination = false, bool receiptCostingParameters = false, bool receiptEvents = false, bool receiptOutput = true, bool affectedGlobalEntities = false, bool balanceChanges = false) + public TransactionDetailsOptIns(bool rawHex = false, bool receiptStateChanges = false, bool receiptFeeSummary = false, bool receiptFeeSource = false, bool receiptFeeDestination = false, bool receiptCostingParameters = false, bool receiptEvents = false, bool receiptOutput = true, bool affectedGlobalEntities = false, bool manifestInstructions = false, bool balanceChanges = false) { this.RawHex = rawHex; this.ReceiptStateChanges = receiptStateChanges; @@ -119,6 +120,7 @@ public TransactionDetailsOptIns(bool rawHex = false, bool receiptStateChanges = this.ReceiptEvents = receiptEvents; this.ReceiptOutput = receiptOutput; this.AffectedGlobalEntities = affectedGlobalEntities; + this.ManifestInstructions = manifestInstructions; this.BalanceChanges = balanceChanges; } @@ -185,6 +187,13 @@ public TransactionDetailsOptIns(bool rawHex = false, bool receiptStateChanges = [DataMember(Name = "affected_global_entities", EmitDefaultValue = true)] public bool AffectedGlobalEntities { get; set; } + /// + /// if set to `true`, manifest instructions for user transactions are returned. + /// + /// if set to `true`, manifest instructions for user transactions are returned. + [DataMember(Name = "manifest_instructions", EmitDefaultValue = true)] + public bool ManifestInstructions { get; set; } + /// /// if set to `true`, returns the fungible and non-fungible balance changes. **Warning!** This opt-in might be missing for recently committed transactions, in that case a `null` value will be returned. Retry the request until non-null value is returned. /// @@ -209,6 +218,7 @@ public override string ToString() sb.Append(" ReceiptEvents: ").Append(ReceiptEvents).Append("\n"); sb.Append(" ReceiptOutput: ").Append(ReceiptOutput).Append("\n"); sb.Append(" AffectedGlobalEntities: ").Append(AffectedGlobalEntities).Append("\n"); + sb.Append(" ManifestInstructions: ").Append(ManifestInstructions).Append("\n"); sb.Append(" BalanceChanges: ").Append(BalanceChanges).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -281,6 +291,10 @@ public bool Equals(TransactionDetailsOptIns input) this.AffectedGlobalEntities == input.AffectedGlobalEntities || this.AffectedGlobalEntities.Equals(input.AffectedGlobalEntities) ) && + ( + this.ManifestInstructions == input.ManifestInstructions || + this.ManifestInstructions.Equals(input.ManifestInstructions) + ) && ( this.BalanceChanges == input.BalanceChanges || this.BalanceChanges.Equals(input.BalanceChanges) @@ -305,6 +319,7 @@ public override int GetHashCode() hashCode = (hashCode * 59) + this.ReceiptEvents.GetHashCode(); hashCode = (hashCode * 59) + this.ReceiptOutput.GetHashCode(); hashCode = (hashCode * 59) + this.AffectedGlobalEntities.GetHashCode(); + hashCode = (hashCode * 59) + this.ManifestInstructions.GetHashCode(); hashCode = (hashCode * 59) + this.BalanceChanges.GetHashCode(); return hashCode; } diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/LedgerExtension/PostgresLedgerExtenderService.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/LedgerExtension/PostgresLedgerExtenderService.cs index ad9b7f03c..046255cba 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/LedgerExtension/PostgresLedgerExtenderService.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/LedgerExtension/PostgresLedgerExtenderService.cs @@ -539,6 +539,7 @@ private async Task ProcessTransactions(ReadWriteDbContext db SignedIntentHash = ult.NotarizedTransaction.SignedIntent.HashBech32m, Message = ult.NotarizedTransaction.SignedIntent.Intent.Message?.ToJson(), RawPayload = ult.NotarizedTransaction.GetPayloadBytes(), + ManifestInstructions = ult.NotarizedTransaction.SignedIntent.Intent.Instructions, }, CoreModel.RoundUpdateLedgerTransaction => new RoundUpdateLedgerTransaction(), CoreModel.FlashLedgerTransaction => new FlashLedgerTransaction(), diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/LedgerExtension/WriteHelper.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/LedgerExtension/WriteHelper.cs index 505a4a1f7..e9c8fdef7 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/LedgerExtension/WriteHelper.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/LedgerExtension/WriteHelper.cs @@ -214,7 +214,7 @@ public async Task CopyLedgerTransaction(ICollection enti var sw = Stopwatch.GetTimestamp(); await using var writer = await _connection.BeginBinaryImportAsync( - "COPY ledger_transactions (state_version, transaction_tree_hash, receipt_tree_hash, state_tree_hash, epoch, round_in_epoch, index_in_epoch, index_in_round, fee_paid, tip_paid, affected_global_entities, round_timestamp, created_timestamp, normalized_round_timestamp, balance_changes, receipt_state_updates, receipt_status, receipt_fee_summary, receipt_fee_source, receipt_fee_destination, receipt_costing_parameters, receipt_error_message, receipt_output, receipt_next_epoch, receipt_event_emitters, receipt_event_names, receipt_event_sbors, receipt_event_schema_entity_ids, receipt_event_schema_hashes, receipt_event_type_indexes, receipt_event_sbor_type_kinds, discriminator, payload_hash, intent_hash, signed_intent_hash, message, raw_payload) FROM STDIN (FORMAT BINARY)", + "COPY ledger_transactions (state_version, transaction_tree_hash, receipt_tree_hash, state_tree_hash, epoch, round_in_epoch, index_in_epoch, index_in_round, fee_paid, tip_paid, affected_global_entities, round_timestamp, created_timestamp, normalized_round_timestamp, balance_changes, receipt_state_updates, receipt_status, receipt_fee_summary, receipt_fee_source, receipt_fee_destination, receipt_costing_parameters, receipt_error_message, receipt_output, receipt_next_epoch, receipt_event_emitters, receipt_event_names, receipt_event_sbors, receipt_event_schema_entity_ids, receipt_event_schema_hashes, receipt_event_type_indexes, receipt_event_sbor_type_kinds, discriminator, payload_hash, intent_hash, signed_intent_hash, message, raw_payload, manifest_instructions) FROM STDIN (FORMAT BINARY)", token); foreach (var lt in entities) @@ -266,6 +266,7 @@ public async Task CopyLedgerTransaction(ICollection enti await writer.WriteNullAsync(token); await writer.WriteNullAsync(token); await writer.WriteNullAsync(token); + await writer.WriteNullAsync(token); break; case UserLedgerTransaction ult: await writer.WriteAsync(ult.PayloadHash, NpgsqlDbType.Text, token); @@ -273,6 +274,7 @@ public async Task CopyLedgerTransaction(ICollection enti await writer.WriteAsync(ult.SignedIntentHash, NpgsqlDbType.Text, token); await writer.WriteAsync(ult.Message, NpgsqlDbType.Jsonb, token); await writer.WriteAsync(ult.RawPayload, NpgsqlDbType.Bytea, token); + await writer.WriteAsync(ult.ManifestInstructions, NpgsqlDbType.Text, token); break; default: throw new ArgumentOutOfRangeException(nameof(lt), lt, null); diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240112100632_InitialCreate.Designer.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240112101654_InitialCreate.Designer.cs similarity index 99% rename from src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240112100632_InitialCreate.Designer.cs rename to src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240112101654_InitialCreate.Designer.cs index 1caca4897..3a7e62b1a 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240112100632_InitialCreate.Designer.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240112101654_InitialCreate.Designer.cs @@ -80,7 +80,7 @@ namespace RadixDlt.NetworkGateway.PostgresIntegration.Migrations { [DbContext(typeof(MigrationsDbContext))] - [Migration("20240112100632_InitialCreate")] + [Migration("20240112101654_InitialCreate")] partial class InitialCreate { /// @@ -2105,6 +2105,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("text") .HasColumnName("intent_hash"); + b.Property("ManifestInstructions") + .IsRequired() + .HasColumnType("text") + .HasColumnName("manifest_instructions"); + b.Property("Message") .HasColumnType("jsonb") .HasColumnName("message"); diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240112100632_InitialCreate.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240112101654_InitialCreate.cs similarity index 99% rename from src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240112100632_InitialCreate.cs rename to src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240112101654_InitialCreate.cs index 03ca91e36..bfbadd5ba 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240112100632_InitialCreate.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240112101654_InitialCreate.cs @@ -441,7 +441,8 @@ protected override void Up(MigrationBuilder migrationBuilder) intent_hash = table.Column(type: "text", nullable: true), signed_intent_hash = table.Column(type: "text", nullable: true), message = table.Column(type: "jsonb", nullable: true), - raw_payload = table.Column(type: "bytea", nullable: true) + raw_payload = table.Column(type: "bytea", nullable: true), + manifest_instructions = table.Column(type: "text", nullable: true) }, constraints: table => { diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/IdempotentApplyMigrations.sql b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/IdempotentApplyMigrations.sql index c76f863d9..1921c0b16 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/IdempotentApplyMigrations.sql +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/IdempotentApplyMigrations.sql @@ -9,7 +9,7 @@ START TRANSACTION; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TYPE account_default_deposit_rule AS ENUM ('accept', 'reject', 'allow_existing'); CREATE TYPE account_resource_preference_rule AS ENUM ('allowed', 'disallowed'); CREATE TYPE entity_type AS ENUM ('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'); @@ -34,7 +34,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE account_default_deposit_rule_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -47,7 +47,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE account_resource_preference_rule_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -62,7 +62,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE component_method_royalty_entry_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -77,7 +77,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE entities ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -109,7 +109,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE entity_metadata_aggregate_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -122,7 +122,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE entity_metadata_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -138,7 +138,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE entity_resource_aggregate_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -154,7 +154,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE entity_resource_aggregated_vaults_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -170,7 +170,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE entity_resource_vault_aggregate_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -184,7 +184,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE entity_role_assignments_aggregate_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -198,7 +198,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE entity_role_assignments_entry_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -214,7 +214,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE entity_role_assignments_owner_role_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -227,7 +227,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE entity_vault_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -246,7 +246,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE key_value_store_entry_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -262,7 +262,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE key_value_store_schema_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -282,7 +282,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE ledger_transaction_markers ( id bigint GENERATED BY DEFAULT AS IDENTITY, state_version bigint NOT NULL, @@ -302,7 +302,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE ledger_transactions ( state_version bigint NOT NULL, epoch bigint NOT NULL, @@ -341,6 +341,7 @@ BEGIN signed_intent_hash text NULL, message jsonb NULL, raw_payload bytea NULL, + manifest_instructions text NULL, CONSTRAINT "PK_ledger_transactions" PRIMARY KEY (state_version) ); END IF; @@ -348,7 +349,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE non_fungible_id_data ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -361,7 +362,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE non_fungible_id_data_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -376,7 +377,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE non_fungible_id_location_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -389,7 +390,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE non_fungible_id_store_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -402,7 +403,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE non_fungible_schema_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -418,7 +419,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE package_blueprint_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -438,7 +439,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE package_code_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -452,7 +453,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE pending_transactions ( id bigint GENERATED BY DEFAULT AS IDENTITY, payload_hash text NOT NULL, @@ -480,7 +481,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE resource_entity_supply_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -495,7 +496,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE schema_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -509,7 +510,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE state_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -528,7 +529,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE validator_emission_statistics ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -543,7 +544,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE validator_public_key_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -557,7 +558,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE pending_transaction_payloads ( id bigint GENERATED BY DEFAULT AS IDENTITY, pending_transaction_id bigint NULL, @@ -570,7 +571,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE TABLE validator_active_set_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -585,394 +586,394 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_account_default_deposit_rule_history_account_entity_id_from~" ON account_default_deposit_rule_history (account_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_account_resource_preference_rule_history_account_entity_id_~" ON account_resource_preference_rule_history (account_entity_id, resource_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_component_method_royalty_entry_history_entity_id_from_state~" ON component_method_royalty_entry_history (entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_component_method_royalty_entry_history_entity_id_method_nam~" ON component_method_royalty_entry_history (entity_id, method_name, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE UNIQUE INDEX "IX_entities_address" ON entities (address); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_entities_from_state_version" ON entities (from_state_version) WHERE discriminator = 'global_validator'; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_entity_metadata_aggregate_history_entity_id_from_state_vers~" ON entity_metadata_aggregate_history (entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_entity_metadata_history_entity_id_key_from_state_version" ON entity_metadata_history (entity_id, key, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_entity_resource_aggregate_history_entity_id_from_state_vers~" ON entity_resource_aggregate_history (entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_entity_resource_aggregated_vaults_history_entity_id_resourc~" ON entity_resource_aggregated_vaults_history (entity_id, resource_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_entity_resource_vault_aggregate_history_entity_id_resource_~" ON entity_resource_vault_aggregate_history (entity_id, resource_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_entity_role_assignments_aggregate_history_entity_id_from_st~" ON entity_role_assignments_aggregate_history (entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_entity_role_assignments_entry_history_entity_id_key_role_ke~" ON entity_role_assignments_entry_history (entity_id, key_role, key_module, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_entity_role_assignments_owner_role_history_entity_id_from_s~" ON entity_role_assignments_owner_role_history (entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_entity_vault_history_global_entity_id_from_state_version" ON entity_vault_history (global_entity_id, from_state_version) WHERE is_royalty_vault = true; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_entity_vault_history_global_entity_id_vault_entity_id_from_~" ON entity_vault_history (global_entity_id, vault_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_entity_vault_history_id_resource_entity_id_from_state_versi~" ON entity_vault_history (id, resource_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_entity_vault_history_owner_entity_id_from_state_version" ON entity_vault_history (owner_entity_id, from_state_version) WHERE is_royalty_vault = true; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_entity_vault_history_owner_entity_id_vault_entity_id_from_s~" ON entity_vault_history (owner_entity_id, vault_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_entity_vault_history_vault_entity_id_from_state_version" ON entity_vault_history (vault_entity_id, from_state_version) WHERE discriminator = 'non_fungible'; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_key_value_store_entry_history_key_value_store_entity_id_key~" ON key_value_store_entry_history (key_value_store_entity_id, key, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_key_value_store_schema_history_key_value_store_entity_id_fr~" ON key_value_store_schema_history (key_value_store_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_ledger_transaction_markers_entity_id_state_version" ON ledger_transaction_markers (entity_id, state_version) WHERE discriminator = 'affected_global_entity'; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_ledger_transaction_markers_event_type_entity_id_state_versi~" ON ledger_transaction_markers (event_type, entity_id, state_version) WHERE discriminator = 'event'; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_ledger_transaction_markers_manifest_class_is_most_specific_~" ON ledger_transaction_markers (manifest_class, is_most_specific, state_version) WHERE discriminator = 'manifest_class'; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_ledger_transaction_markers_operation_type_entity_id_state_v~" ON ledger_transaction_markers (operation_type, entity_id, state_version) WHERE discriminator = 'manifest_address'; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_ledger_transaction_markers_origin_type_state_version" ON ledger_transaction_markers (origin_type, state_version) WHERE discriminator = 'origin'; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_ledger_transaction_markers_state_version" ON ledger_transaction_markers (state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE UNIQUE INDEX "IX_ledger_transactions_epoch_round_in_epoch" ON ledger_transactions (epoch, round_in_epoch) WHERE index_in_round = 0; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_ledger_transactions_intent_hash" ON ledger_transactions USING hash (intent_hash) WHERE intent_hash IS NOT NULL; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_ledger_transactions_round_timestamp" ON ledger_transactions (round_timestamp); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_non_fungible_id_data_non_fungible_resource_entity_id_from_s~" ON non_fungible_id_data (non_fungible_resource_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE UNIQUE INDEX "IX_non_fungible_id_data_non_fungible_resource_entity_id_non_fu~" ON non_fungible_id_data (non_fungible_resource_entity_id, non_fungible_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_non_fungible_id_data_history_non_fungible_id_data_id_from_s~" ON non_fungible_id_data_history (non_fungible_id_data_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_non_fungible_id_location_history_non_fungible_id_data_id_fr~" ON non_fungible_id_location_history (non_fungible_id_data_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_non_fungible_id_store_history_non_fungible_resource_entity_~" ON non_fungible_id_store_history (non_fungible_resource_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_non_fungible_schema_history_resource_entity_id_from_state_v~" ON non_fungible_schema_history (resource_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_package_blueprint_history_package_entity_id_from_state_vers~" ON package_blueprint_history (package_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_package_blueprint_history_package_entity_id_name_version_fr~" ON package_blueprint_history (package_entity_id, name, version, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_package_code_history_package_entity_id_from_state_version" ON package_code_history (package_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE UNIQUE INDEX "IX_pending_transaction_payloads_pending_transaction_id" ON pending_transaction_payloads (pending_transaction_id); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_pending_transactions_first_submitted_to_gateway_timestamp" ON pending_transactions (first_submitted_to_gateway_timestamp); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_pending_transactions_intent_hash" ON pending_transactions (intent_hash); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE UNIQUE INDEX "IX_pending_transactions_payload_hash" ON pending_transactions (payload_hash); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_pending_transactions_resubmit_from_timestamp" ON pending_transactions (resubmit_from_timestamp); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_resource_entity_supply_history_resource_entity_id_from_stat~" ON resource_entity_supply_history (resource_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_schema_history_entity_id_from_state_version" ON schema_history (entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_schema_history_schema_hash_from_state_version" ON schema_history (schema_hash, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_state_history_entity_id_from_state_version" ON state_history (entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_validator_active_set_history_epoch" ON validator_active_set_history (epoch); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_validator_active_set_history_from_state_version" ON validator_active_set_history (from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_validator_active_set_history_validator_public_key_history_id" ON validator_active_set_history (validator_public_key_history_id); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_validator_emission_statistics_validator_entity_id_epoch_num~" ON validator_emission_statistics (validator_entity_id, epoch_number); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_validator_public_key_history_validator_entity_id_from_state~" ON validator_public_key_history (validator_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN CREATE INDEX "IX_validator_public_key_history_validator_entity_id_key_type_k~" ON validator_public_key_history (validator_entity_id, key_type, key); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112100632_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240112101654_InitialCreate') THEN INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion") - VALUES ('20240112100632_InitialCreate', '7.0.11'); + VALUES ('20240112101654_InitialCreate', '7.0.11'); END IF; END $EF$; COMMIT; diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/MigrationsDbContextModelSnapshot.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/MigrationsDbContextModelSnapshot.cs index 2a0fc5611..8b8565872 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/MigrationsDbContextModelSnapshot.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/MigrationsDbContextModelSnapshot.cs @@ -2102,6 +2102,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("text") .HasColumnName("intent_hash"); + b.Property("ManifestInstructions") + .IsRequired() + .HasColumnType("text") + .HasColumnName("manifest_instructions"); + b.Property("Message") .HasColumnType("jsonb") .HasColumnName("message"); diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Models/LedgerTransaction.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Models/LedgerTransaction.cs index 0d9544d90..8d0f36c4c 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Models/LedgerTransaction.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Models/LedgerTransaction.cs @@ -232,6 +232,9 @@ internal class UserLedgerTransaction : LedgerTransaction /// [Column("raw_payload")] public byte[] RawPayload { get; set; } + + [Column("manifest_instructions")] + public string ManifestInstructions { get; set; } } internal class RoundUpdateLedgerTransaction : LedgerTransaction diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/TransactionQuerier.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/TransactionQuerier.cs index eef421886..103c7554e 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/TransactionQuerier.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/TransactionQuerier.cs @@ -694,7 +694,8 @@ WITH configuration AS ( {optIns.ReceiptOutput} AS with_receipt_output, {optIns.ReceiptStateChanges} AS with_receipt_state_updates, {optIns.ReceiptEvents} AS with_receipt_events, - {optIns.BalanceChanges} AS with_balance_changes + {optIns.BalanceChanges} AS with_balance_changes, + {optIns.ManifestInstructions} AS with_manifest_instructions ) SELECT state_version, epoch, round_in_epoch, index_in_epoch, @@ -717,6 +718,7 @@ WITH configuration AS ( CASE WHEN configuration.with_receipt_events THEN receipt_event_type_indexes ELSE '{{}}'::bigint[] END AS receipt_event_type_indexes, CASE WHEN configuration.with_receipt_events THEN receipt_event_sbor_type_kinds ELSE '{{}}'::sbor_type_kind[] END AS receipt_event_sbor_type_kinds, CASE WHEN configuration.with_balance_changes THEN balance_changes ELSE '{{}}'::jsonb END AS balance_changes + CASE WHEN configuration.with_manifest_instructions THEN manifest_instructions ELSE ''::text END AS manifest_instructions FROM ledger_transactions, configuration WHERE state_version = ANY({transactionStateVersions})") .AnnotateMetricName("GetTransactions")