From 030328ff3f40cb1aac8f70ce97c807064238d656 Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Thu, 24 Aug 2023 13:25:06 -0700 Subject: [PATCH] Re-generate EF migration code Signed-off-by: Victor Chang --- doc/dependency_decisions.yml | 12 +- docs/compliance/third-party-licenses.md | 12 +- .../20230824185313_R4_0.4.0.Designer.cs | 378 ++++++++++++++++++ .../Migrations/20230824185313_R4_0.4.0.cs | 96 +++++ .../Services/Storage/ObjectUploadService.cs | 8 +- 5 files changed, 489 insertions(+), 17 deletions(-) create mode 100644 src/Database/EntityFramework/Migrations/20230824185313_R4_0.4.0.Designer.cs create mode 100644 src/Database/EntityFramework/Migrations/20230824185313_R4_0.4.0.cs diff --git a/doc/dependency_decisions.yml b/doc/dependency_decisions.yml index 9db860814..5e1a5ecfe 100644 --- a/doc/dependency_decisions.yml +++ b/doc/dependency_decisions.yml @@ -314,7 +314,7 @@ :why: MIT (https://github.com/microsoft/vstest/raw/main/LICENSE) :versions: - 17.4.1 - - 17.6.3 + - 17.7.1 :when: 2022-08-16 23:05:48.342748414 Z - - :approve - Microsoft.Data.Sqlite.Core @@ -682,7 +682,7 @@ :why: MIT (https://raw.githubusercontent.com/microsoft/vstest/main/LICENSE) :versions: - 17.4.1 - - 17.6.3 + - 17.7.1 :when: 2022-09-01 23:06:13.008314524 Z - - :approve - Microsoft.NETCore.Platforms @@ -733,7 +733,7 @@ :why: MIT (https://github.com/microsoft/vstest/raw/v17.4.0/LICENSE) :versions: - 17.4.1 - - 17.6.3 + - 17.7.1 :when: 2022-08-16 23:06:16.175705981 Z - - :approve - Microsoft.TestPlatform.TestHost @@ -741,7 +741,7 @@ :why: MIT (https://github.com/microsoft/vstest/raw/v17.4.0/LICENSE) :versions: - 17.4.1 - - 17.6.3 + - 17.7.1 :when: 2022-08-16 23:06:17.671459450 Z - - :approve - Microsoft.Toolkit.HighPerformance @@ -783,14 +783,14 @@ - :who: neilsouth :why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE) :versions: - - 0.1.25 + - 1.0.0 :when: 2022-08-16 23:06:21.051573547 Z - - :approve - Monai.Deploy.Messaging.RabbitMQ - :who: neilsouth :why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE) :versions: - - 0.1.25 + - 1.0.0 :when: 2022-08-16 23:06:21.511789690 Z - - :approve - Monai.Deploy.Storage diff --git a/docs/compliance/third-party-licenses.md b/docs/compliance/third-party-licenses.md index 01ea8edd8..509e18f15 100644 --- a/docs/compliance/third-party-licenses.md +++ b/docs/compliance/third-party-licenses.md @@ -7304,14 +7304,14 @@ Apache License
-Monai.Deploy.Messaging 0.1.25 +Monai.Deploy.Messaging 1.0.0 ## Monai.Deploy.Messaging -- Version: 0.1.25 +- Version: 1.0.0 - Authors: MONAI Consortium - Project URL: https://github.com/Project-MONAI/monai-deploy-messaging -- Source: [NuGet](https://www.nuget.org/packages/Monai.Deploy.Messaging/0.1.25) +- Source: [NuGet](https://www.nuget.org/packages/Monai.Deploy.Messaging/1.0.0) - License: [Apache-2.0](https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE) @@ -7532,14 +7532,14 @@ By downloading this software, you agree to the license terms & all licenses list
-Monai.Deploy.Messaging.RabbitMQ 0.1.25 +Monai.Deploy.Messaging.RabbitMQ 1.0.0 ## Monai.Deploy.Messaging.RabbitMQ -- Version: 0.1.25 +- Version: 1.0.0 - Authors: MONAI Consortium - Project URL: https://github.com/Project-MONAI/monai-deploy-messaging -- Source: [NuGet](https://www.nuget.org/packages/Monai.Deploy.Messaging.RabbitMQ/0.1.25) +- Source: [NuGet](https://www.nuget.org/packages/Monai.Deploy.Messaging.RabbitMQ/1.0.0) - License: [Apache-2.0](https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE) diff --git a/src/Database/EntityFramework/Migrations/20230824185313_R4_0.4.0.Designer.cs b/src/Database/EntityFramework/Migrations/20230824185313_R4_0.4.0.Designer.cs new file mode 100644 index 000000000..954d66342 --- /dev/null +++ b/src/Database/EntityFramework/Migrations/20230824185313_R4_0.4.0.Designer.cs @@ -0,0 +1,378 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Monai.Deploy.InformaticsGateway.Database.EntityFramework; + +#nullable disable + +namespace Monai.Deploy.InformaticsGateway.Database.Migrations +{ + [DbContext(typeof(InformaticsGatewayContext))] + [Migration("20230824185313_R4_0.4.0")] + partial class R4_040 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "6.0.21"); + + modelBuilder.Entity("Monai.Deploy.InformaticsGateway.Api.DestinationApplicationEntity", b => + { + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("AeTitle") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("DateTimeCreated") + .HasColumnType("TEXT"); + + b.Property("DateTimeUpdated") + .HasColumnType("TEXT"); + + b.Property("HostIp") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Port") + .HasColumnType("INTEGER"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT"); + + b.HasKey("Name"); + + b.HasIndex(new[] { "Name" }, "idx_destination_name") + .IsUnique(); + + b.HasIndex(new[] { "Name", "AeTitle", "HostIp", "Port" }, "idx_source_all") + .IsUnique(); + + b.ToTable("DestinationApplicationEntities"); + }); + + modelBuilder.Entity("Monai.Deploy.InformaticsGateway.Api.DicomAssociationInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("CalledAeTitle") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CallingAeTitle") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CorrelationId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("DateTimeCreated") + .HasColumnType("TEXT"); + + b.Property("DateTimeDisconnected") + .HasColumnType("TEXT"); + + b.Property("Duration") + .HasColumnType("TEXT"); + + b.Property("Errors") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("FileCount") + .HasColumnType("INTEGER"); + + b.Property("RemoteHost") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("RemotePort") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("DicomAssociationHistories"); + }); + + modelBuilder.Entity("Monai.Deploy.InformaticsGateway.Api.MonaiApplicationEntity", b => + { + b.Property("Name") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("AeTitle") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("AllowedSopClasses") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("DateTimeCreated") + .HasColumnType("TEXT"); + + b.Property("DateTimeUpdated") + .HasColumnType("TEXT"); + + b.Property("Grouping") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("IgnoredSopClasses") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("PlugInAssemblies") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Timeout") + .HasColumnType("INTEGER"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT"); + + b.Property("Workflows") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Name"); + + b.HasIndex(new[] { "Name" }, "idx_monaiae_name") + .IsUnique(); + + b.ToTable("MonaiApplicationEntities"); + }); + + modelBuilder.Entity("Monai.Deploy.InformaticsGateway.Api.Rest.InferenceRequest", b => + { + b.Property("InferenceRequestId") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("DateTimeCreated") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("InputMetadata") + .HasColumnType("TEXT"); + + b.Property("InputResources") + .HasColumnType("TEXT"); + + b.Property("OutputResources") + .HasColumnType("TEXT"); + + b.Property("Priority") + .HasColumnType("INTEGER"); + + b.Property("State") + .HasColumnType("INTEGER"); + + b.Property("Status") + .HasColumnType("INTEGER"); + + b.Property("TransactionId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("TryCount") + .HasColumnType("INTEGER"); + + b.HasKey("InferenceRequestId"); + + b.HasIndex(new[] { "InferenceRequestId" }, "idx_inferencerequest_inferencerequestid") + .IsUnique(); + + b.HasIndex(new[] { "State" }, "idx_inferencerequest_state"); + + b.HasIndex(new[] { "TransactionId" }, "idx_inferencerequest_transactionid") + .IsUnique(); + + b.ToTable("InferenceRequests"); + }); + + modelBuilder.Entity("Monai.Deploy.InformaticsGateway.Api.SourceApplicationEntity", b => + { + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("AeTitle") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("DateTimeCreated") + .HasColumnType("TEXT"); + + b.Property("DateTimeUpdated") + .HasColumnType("TEXT"); + + b.Property("HostIp") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT"); + + b.HasKey("Name"); + + b.HasIndex(new[] { "Name", "AeTitle", "HostIp" }, "idx_source_all") + .IsUnique() + .HasDatabaseName("idx_source_all1"); + + b.HasIndex(new[] { "Name" }, "idx_source_name") + .IsUnique(); + + b.ToTable("SourceApplicationEntities"); + }); + + modelBuilder.Entity("Monai.Deploy.InformaticsGateway.Api.Storage.Payload", b => + { + b.Property("PayloadId") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("CorrelationId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("DataOrigins") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("DataTrigger") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("DateTimeCreated") + .HasColumnType("TEXT"); + + b.Property("Files") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Key") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("MachineName") + .HasColumnType("TEXT"); + + b.Property("RetryCount") + .HasColumnType("INTEGER"); + + b.Property("State") + .HasColumnType("INTEGER"); + + b.Property("TaskId") + .HasColumnType("TEXT"); + + b.Property("Timeout") + .HasColumnType("INTEGER"); + + b.Property("WorkflowInstanceId") + .HasColumnType("TEXT"); + + b.HasKey("PayloadId"); + + b.HasIndex(new[] { "CorrelationId", "PayloadId" }, "idx_payload_ids") + .IsUnique(); + + b.HasIndex(new[] { "State" }, "idx_payload_state"); + + b.ToTable("Payloads"); + }); + + modelBuilder.Entity("Monai.Deploy.InformaticsGateway.Api.VirtualApplicationEntity", b => + { + b.Property("Name") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("DateTimeCreated") + .HasColumnType("TEXT"); + + b.Property("DateTimeUpdated") + .HasColumnType("TEXT"); + + b.Property("PlugInAssemblies") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT"); + + b.Property("VirtualAeTitle") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Workflows") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Name"); + + b.HasIndex(new[] { "Name" }, "idx_virtualae_name") + .IsUnique(); + + b.ToTable("VirtualApplicationEntities"); + }); + + modelBuilder.Entity("Monai.Deploy.InformaticsGateway.Database.Api.StorageMetadataWrapper", b => + { + b.Property("CorrelationId") + .HasColumnType("TEXT"); + + b.Property("Identity") + .HasColumnType("TEXT"); + + b.Property("DateTimeCreated") + .HasColumnType("TEXT"); + + b.Property("IsUploaded") + .HasColumnType("INTEGER"); + + b.Property("TypeName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Value") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("CorrelationId", "Identity"); + + b.HasIndex(new[] { "CorrelationId" }, "idx_storagemetadata_correlation"); + + b.HasIndex(new[] { "CorrelationId", "Identity" }, "idx_storagemetadata_ids"); + + b.HasIndex(new[] { "IsUploaded" }, "idx_storagemetadata_uploaded"); + + b.ToTable("StorageMetadataWrapperEntities"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Database/EntityFramework/Migrations/20230824185313_R4_0.4.0.cs b/src/Database/EntityFramework/Migrations/20230824185313_R4_0.4.0.cs new file mode 100644 index 000000000..fd7fe88f6 --- /dev/null +++ b/src/Database/EntityFramework/Migrations/20230824185313_R4_0.4.0.cs @@ -0,0 +1,96 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Monai.Deploy.InformaticsGateway.Database.Migrations +{ + public partial class R4_040 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "DataOrigins", + table: "Payloads", + type: "TEXT", + nullable: false, + defaultValue: ""); + + migrationBuilder.AddColumn( + name: "DataTrigger", + table: "Payloads", + type: "TEXT", + nullable: false, + defaultValue: ""); + + migrationBuilder.AddColumn( + name: "TaskId", + table: "Payloads", + type: "TEXT", + nullable: true); + + migrationBuilder.AddColumn( + name: "WorkflowInstanceId", + table: "Payloads", + type: "TEXT", + nullable: true); + + migrationBuilder.AddColumn( + name: "PlugInAssemblies", + table: "MonaiApplicationEntities", + type: "TEXT", + nullable: false, + defaultValue: ""); + + migrationBuilder.CreateTable( + name: "VirtualApplicationEntities", + columns: table => new + { + Name = table.Column(type: "TEXT", nullable: false), + VirtualAeTitle = table.Column(type: "TEXT", nullable: false), + Workflows = table.Column(type: "TEXT", nullable: false), + PlugInAssemblies = table.Column(type: "TEXT", nullable: false), + CreatedBy = table.Column(type: "TEXT", nullable: true), + UpdatedBy = table.Column(type: "TEXT", nullable: true), + DateTimeUpdated = table.Column(type: "TEXT", nullable: true), + DateTimeCreated = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_VirtualApplicationEntities", x => x.Name); + }); + + migrationBuilder.CreateIndex( + name: "idx_virtualae_name", + table: "VirtualApplicationEntities", + column: "Name", + unique: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "VirtualApplicationEntities"); + + migrationBuilder.DropColumn( + name: "DataOrigins", + table: "Payloads"); + + migrationBuilder.DropColumn( + name: "DataTrigger", + table: "Payloads"); + + migrationBuilder.DropColumn( + name: "TaskId", + table: "Payloads"); + + migrationBuilder.DropColumn( + name: "WorkflowInstanceId", + table: "Payloads"); + + migrationBuilder.DropColumn( + name: "PlugInAssemblies", + table: "MonaiApplicationEntities"); + } + } +} diff --git a/src/InformaticsGateway/Services/Storage/ObjectUploadService.cs b/src/InformaticsGateway/Services/Storage/ObjectUploadService.cs index 382a9ea44..486fd6bfc 100644 --- a/src/InformaticsGateway/Services/Storage/ObjectUploadService.cs +++ b/src/InformaticsGateway/Services/Storage/ObjectUploadService.cs @@ -193,13 +193,11 @@ private async Task UploadFileAndConfirm(string identifier, StorageObjectMetadata do { await UploadFile(storageObjectMetadata, source, workflows, payloadId, cancellationToken).ConfigureAwait(false); - if (count-- <= 0) + if (--count <= 0) { throw new FileUploadException($"Failed to upload file after retries {identifier}."); } - } while (!( - await VerifyExists(storageObjectMetadata.GetPayloadPath(Guid.Parse(payloadId)), cancellationToken).ConfigureAwait(false) - )); + } while (!(await VerifyExists(storageObjectMetadata.GetPayloadPath(Guid.Parse(payloadId)), cancellationToken).ConfigureAwait(false))); } private async Task VerifyExists(string path, CancellationToken cancellationToken) @@ -283,4 +281,4 @@ public void Dispose() GC.SuppressFinalize(this); } } -} \ No newline at end of file +}