From ab459494888e5e6170c05f25c98b79c3152397ea Mon Sep 17 00:00:00 2001 From: John Simons Date: Wed, 2 Sep 2026 08:25:33 +1000 Subject: [PATCH 1/2] Merge PostgreSQL EF Core migrations into a single consolidated migration Replaces the series of incremental migrations (Initial, AddFullTextSearch, AddKnownEndpointMaxLength, AddConfiguration, AddFailedErrorImports, AddSubscriptions, DropDuplicateQueueAddress, EventLogItems, AddFailureGroupClassifierIndex, NullableEndpointAddress, AddGroupComments, AddMessageRedirects) with a single squashed migration representing the final schema state. --- .../20260722061312_Initial.Designer.cs | 262 ------ .../Migrations/20260722061312_Initial.cs | 151 --- ...260722061316_AddFullTextSearch.Designer.cs | 262 ------ ...2351_AddKnownEndpointMaxLength.Designer.cs | 264 ------ ...0260723082351_AddKnownEndpointMaxLength.cs | 54 -- ...0260727041318_AddConfiguration.Designer.cs | 315 ------- .../20260727041318_AddConfiguration.cs | 77 -- ...28233024_AddFailedErrorImports.Designer.cs | 359 ------- .../20260728233024_AddFailedErrorImports.cs | 44 - ...0260729053645_AddSubscriptions.Designer.cs | 383 -------- .../20260729053645_AddSubscriptions.cs | 34 - ...3309_DropDuplicateQueueAddress.Designer.cs | 375 -------- ...0260731003309_DropDuplicateQueueAddress.cs | 38 - .../20260731010357_EventLogItems.Designer.cs | 433 --------- .../20260731010357_EventLogItems.cs | 48 - ...AddFailureGroupClassifierIndex.Designer.cs | 378 -------- ...31043221_AddFailureGroupClassifierIndex.cs | 27 - ...043356_NullableEndpointAddress.Designer.cs | 432 --------- .../20260731043356_NullableEndpointAddress.cs | 40 - ...0260801000409_AddGroupComments.Designer.cs | 445 --------- .../20260801000409_AddGroupComments.cs | 33 - ...0802023138_AddMessageRedirects.Designer.cs | 468 --------- .../20260802023138_AddMessageRedirects.cs | 35 - ...20260803021015_AddRetryBatches.Designer.cs | 568 ----------- .../20260803021015_AddRetryBatches.cs | 109 --- ...60804052012_AddArchiveEntities.Designer.cs | 686 -------------- .../20260804052012_AddArchiveEntities.cs | 81 -- ...20260804222120_AddRetryHistory.Designer.cs | 717 -------------- .../20260804222120_AddRetryHistory.cs | 70 -- .../20260807012019_AddSettings.Designer.cs | 774 --------------- .../Migrations/20260807012019_AddSettings.cs | 56 -- ...7053832_AddLicensingThroughput.Designer.cs | 866 ----------------- .../20260807053832_AddLicensingThroughput.cs | 74 -- ...11010034_AddFailedMessageEdits.Designer.cs | 887 ------------------ .../20260811010034_AddFailedMessageEdits.cs | 39 - ..._AddExternalIntegrationDispatchRequests.cs | 36 - ...00001_MakeFailingEndpointAddressNonNull.cs | 43 - ....cs => 20260901221615_Initial.Designer.cs} | 28 +- .../Migrations/20260901221615_Initial.cs | 544 +++++++++++ ...60901221623_AddFullTextSearch.Designer.cs} | 32 +- ...cs => 20260901221623_AddFullTextSearch.cs} | 0 ...SqlServiceControlDbContextModelSnapshot.cs | 2 +- .../20260722061320_Initial.Designer.cs | 212 ----- .../Migrations/20260722061320_Initial.cs | 151 --- ...260722061323_AddFullTextSearch.Designer.cs | 212 ----- ...2337_AddKnownEndpointMaxLength.Designer.cs | 214 ----- ...0260723082337_AddKnownEndpointMaxLength.cs | 54 -- ...0260724055947_AddConfiguration.Designer.cs | 257 ----- .../20260724055947_AddConfiguration.cs | 76 -- ...28233017_AddFailedErrorImports.Designer.cs | 292 ------ .../20260728233017_AddFailedErrorImports.cs | 44 - ...0260729053622_AddSubscriptions.Designer.cs | 312 ------ .../20260729053622_AddSubscriptions.cs | 34 - ...3301_DropDuplicateQueueAddress.Designer.cs | 306 ------ ...0260731003301_DropDuplicateQueueAddress.cs | 38 - .../20260731010345_EventLogItems.Designer.cs | 352 ------- .../20260731010345_EventLogItems.cs | 46 - ...AddFailureGroupClassifierIndex.Designer.cs | 308 ------ ...31043129_AddFailureGroupClassifierIndex.cs | 27 - ...043442_NullableEndpointAddress.Designer.cs | 351 ------- .../20260731043442_NullableEndpointAddress.cs | 40 - ...0260801000400_AddGroupComments.Designer.cs | 362 ------- .../20260801000400_AddGroupComments.cs | 33 - ...0802023134_AddMessageRedirects.Designer.cs | 381 -------- .../20260802023134_AddMessageRedirects.cs | 35 - ...20260803021009_AddRetryBatches.Designer.cs | 459 --------- .../20260803021009_AddRetryBatches.cs | 109 --- ...60804052028_AddArchiveEntities.Designer.cs | 551 ----------- .../20260804052028_AddArchiveEntities.cs | 81 -- ...20260804222033_AddRetryHistory.Designer.cs | 576 ------------ .../20260804222033_AddRetryHistory.cs | 69 -- .../20260807012017_AddSettings.Designer.cs | 619 ------------ .../Migrations/20260807012017_AddSettings.cs | 55 -- ...7053830_AddLicensingThroughput.Designer.cs | 694 -------------- .../20260807053830_AddLicensingThroughput.cs | 73 -- ...11010033_AddFailedMessageEdits.Designer.cs | 711 -------------- .../20260811010033_AddFailedMessageEdits.cs | 39 - ..._AddExternalIntegrationDispatchRequests.cs | 35 - ...00000_MakeFailingEndpointAddressNonNull.cs | 43 - ....cs => 20260901221640_Initial.Designer.cs} | 24 +- .../Migrations/20260901221640_Initial.cs | 542 +++++++++++ ...60901221643_AddFullTextSearch.Designer.cs} | 28 +- ...cs => 20260901221643_AddFullTextSearch.cs} | 0 ...verServiceControlDbContextModelSnapshot.cs | 2 +- 84 files changed, 1188 insertions(+), 18228 deletions(-) delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260722061312_Initial.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260722061312_Initial.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260722061316_AddFullTextSearch.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260723082351_AddKnownEndpointMaxLength.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260723082351_AddKnownEndpointMaxLength.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260727041318_AddConfiguration.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260727041318_AddConfiguration.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260728233024_AddFailedErrorImports.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260728233024_AddFailedErrorImports.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260729053645_AddSubscriptions.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260729053645_AddSubscriptions.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731003309_DropDuplicateQueueAddress.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731003309_DropDuplicateQueueAddress.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731010357_EventLogItems.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731010357_EventLogItems.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731043221_AddFailureGroupClassifierIndex.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731043221_AddFailureGroupClassifierIndex.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731043356_NullableEndpointAddress.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731043356_NullableEndpointAddress.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260801000409_AddGroupComments.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260801000409_AddGroupComments.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260802023138_AddMessageRedirects.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260802023138_AddMessageRedirects.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260803021015_AddRetryBatches.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260803021015_AddRetryBatches.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260804052012_AddArchiveEntities.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260804052012_AddArchiveEntities.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260804222120_AddRetryHistory.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260804222120_AddRetryHistory.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260807012019_AddSettings.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260807012019_AddSettings.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260807053832_AddLicensingThroughput.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260807053832_AddLicensingThroughput.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260811010034_AddFailedMessageEdits.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260811010034_AddFailedMessageEdits.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260811033225_AddExternalIntegrationDispatchRequests.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260812000001_MakeFailingEndpointAddressNonNull.cs rename src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/{20260811033225_AddExternalIntegrationDispatchRequests.Designer.cs => 20260901221615_Initial.Designer.cs} (97%) create mode 100644 src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221615_Initial.cs rename src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/{20260812000001_MakeFailingEndpointAddressNonNull.Designer.cs => 20260901221623_AddFullTextSearch.Designer.cs} (96%) rename src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/{20260722061316_AddFullTextSearch.cs => 20260901221623_AddFullTextSearch.cs} (100%) delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260722061320_Initial.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260722061320_Initial.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260722061323_AddFullTextSearch.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260723082337_AddKnownEndpointMaxLength.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260723082337_AddKnownEndpointMaxLength.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260724055947_AddConfiguration.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260724055947_AddConfiguration.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260728233017_AddFailedErrorImports.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260728233017_AddFailedErrorImports.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260729053622_AddSubscriptions.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260729053622_AddSubscriptions.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731003301_DropDuplicateQueueAddress.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731003301_DropDuplicateQueueAddress.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731010345_EventLogItems.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731010345_EventLogItems.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731043129_AddFailureGroupClassifierIndex.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731043129_AddFailureGroupClassifierIndex.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731043442_NullableEndpointAddress.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731043442_NullableEndpointAddress.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260801000400_AddGroupComments.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260801000400_AddGroupComments.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260802023134_AddMessageRedirects.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260802023134_AddMessageRedirects.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260803021009_AddRetryBatches.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260803021009_AddRetryBatches.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260804052028_AddArchiveEntities.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260804052028_AddArchiveEntities.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260804222033_AddRetryHistory.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260804222033_AddRetryHistory.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260807012017_AddSettings.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260807012017_AddSettings.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260807053830_AddLicensingThroughput.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260807053830_AddLicensingThroughput.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260811010033_AddFailedMessageEdits.Designer.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260811010033_AddFailedMessageEdits.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260811033208_AddExternalIntegrationDispatchRequests.cs delete mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260812000000_MakeFailingEndpointAddressNonNull.cs rename src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/{20260811033208_AddExternalIntegrationDispatchRequests.Designer.cs => 20260901221640_Initial.Designer.cs} (97%) create mode 100644 src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221640_Initial.cs rename src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/{20260812000000_MakeFailingEndpointAddressNonNull.Designer.cs => 20260901221643_AddFullTextSearch.Designer.cs} (96%) rename src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/{20260722061323_AddFullTextSearch.cs => 20260901221643_AddFullTextSearch.cs} (100%) diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260722061312_Initial.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260722061312_Initial.Designer.cs deleted file mode 100644 index 465e6178c6..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260722061312_Initial.Designer.cs +++ /dev/null @@ -1,262 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260722061312_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.9") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("QueueAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("queue_address"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("QueueAddress") - .HasDatabaseName("ix_failed_messages_queue_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasColumnType("text") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260722061312_Initial.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260722061312_Initial.cs deleted file mode 100644 index d4b2543aa7..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260722061312_Initial.cs +++ /dev/null @@ -1,151 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class Initial : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "failed_message_retries", - columns: table => new - { - unique_message_id = table.Column(type: "uuid", nullable: false), - retry_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("pk_failed_message_retries", x => x.unique_message_id); - }); - - migrationBuilder.CreateTable( - name: "failed_messages", - columns: table => new - { - unique_message_id = table.Column(type: "uuid", nullable: false), - status = table.Column(type: "integer", nullable: false), - status_changed_at = table.Column(type: "timestamp with time zone", nullable: false), - last_modified = table.Column(type: "timestamp with time zone", nullable: false), - number_of_processing_attempts = table.Column(type: "integer", nullable: false), - first_time_of_failure = table.Column(type: "timestamp with time zone", nullable: false), - last_time_of_failure = table.Column(type: "timestamp with time zone", nullable: false), - last_attempted_at = table.Column(type: "timestamp with time zone", nullable: false), - message_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), - message_type = table.Column(type: "text", nullable: true), - time_sent = table.Column(type: "timestamp with time zone", nullable: true), - conversation_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), - queue_address = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), - sending_endpoint_name = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), - sending_endpoint_host_id = table.Column(type: "uuid", nullable: true), - sending_endpoint_host = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), - receiving_endpoint_name = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), - receiving_endpoint_host_id = table.Column(type: "uuid", nullable: true), - receiving_endpoint_host = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), - exception_type = table.Column(type: "text", nullable: true), - exception_message = table.Column(type: "text", nullable: true), - is_system_message = table.Column(type: "boolean", nullable: false), - headers_json = table.Column(type: "text", nullable: false), - body_text = table.Column(type: "text", nullable: true), - body_stored_externally = table.Column(type: "boolean", nullable: false), - body_size = table.Column(type: "integer", nullable: false), - body_content_type = table.Column(type: "character varying(450)", maxLength: 450, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("pk_failed_messages", x => x.unique_message_id); - }); - - migrationBuilder.CreateTable( - name: "known_endpoints", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - name = table.Column(type: "text", nullable: false), - host_id = table.Column(type: "uuid", nullable: false), - host = table.Column(type: "text", nullable: false), - monitored = table.Column(type: "boolean", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_known_endpoints", x => x.id); - }); - - migrationBuilder.CreateTable( - name: "failed_message_groups", - columns: table => new - { - failed_message_unique_id = table.Column(type: "uuid", nullable: false), - group_id = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), - title = table.Column(type: "text", nullable: false), - type = table.Column(type: "character varying(255)", maxLength: 255, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_failed_message_groups", x => new { x.failed_message_unique_id, x.group_id }); - table.ForeignKey( - name: "fk_failed_message_groups_failed_messages_failed_message_unique", - column: x => x.failed_message_unique_id, - principalTable: "failed_messages", - principalColumn: "unique_message_id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "ix_failed_message_groups_group_id", - table: "failed_message_groups", - column: "group_id"); - - migrationBuilder.CreateIndex( - name: "ix_failed_messages_conversation_id", - table: "failed_messages", - column: "conversation_id"); - - migrationBuilder.CreateIndex( - name: "ix_failed_messages_queue_address", - table: "failed_messages", - column: "queue_address"); - - migrationBuilder.CreateIndex( - name: "ix_failed_messages_receiving_endpoint_name", - table: "failed_messages", - column: "receiving_endpoint_name"); - - migrationBuilder.CreateIndex( - name: "ix_failed_messages_status_changed_at", - table: "failed_messages", - column: "status_changed_at", - filter: "status IN (2, 4)"); - - migrationBuilder.CreateIndex( - name: "ix_failed_messages_status_last_modified", - table: "failed_messages", - columns: new[] { "status", "last_modified" }); - - migrationBuilder.CreateIndex( - name: "ix_failed_messages_time_sent", - table: "failed_messages", - column: "time_sent"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "failed_message_groups"); - - migrationBuilder.DropTable( - name: "failed_message_retries"); - - migrationBuilder.DropTable( - name: "known_endpoints"); - - migrationBuilder.DropTable( - name: "failed_messages"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260722061316_AddFullTextSearch.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260722061316_AddFullTextSearch.Designer.cs deleted file mode 100644 index fe5a5b6bf3..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260722061316_AddFullTextSearch.Designer.cs +++ /dev/null @@ -1,262 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260722061316_AddFullTextSearch")] - partial class AddFullTextSearch - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.9") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("QueueAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("queue_address"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("QueueAddress") - .HasDatabaseName("ix_failed_messages_queue_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasColumnType("text") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260723082351_AddKnownEndpointMaxLength.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260723082351_AddKnownEndpointMaxLength.Designer.cs deleted file mode 100644 index 08116b52f0..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260723082351_AddKnownEndpointMaxLength.Designer.cs +++ /dev/null @@ -1,264 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260723082351_AddKnownEndpointMaxLength")] - partial class AddKnownEndpointMaxLength - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("QueueAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("queue_address"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("QueueAddress") - .HasDatabaseName("ix_failed_messages_queue_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260723082351_AddKnownEndpointMaxLength.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260723082351_AddKnownEndpointMaxLength.cs deleted file mode 100644 index 75a997bed4..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260723082351_AddKnownEndpointMaxLength.cs +++ /dev/null @@ -1,54 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class AddKnownEndpointMaxLength : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "name", - table: "known_endpoints", - type: "character varying(450)", - maxLength: 450, - nullable: false, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - name: "host", - table: "known_endpoints", - type: "character varying(450)", - maxLength: 450, - nullable: false, - oldClrType: typeof(string), - oldType: "text"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "name", - table: "known_endpoints", - type: "text", - nullable: false, - oldClrType: typeof(string), - oldType: "character varying(450)", - oldMaxLength: 450); - - migrationBuilder.AlterColumn( - name: "host", - table: "known_endpoints", - type: "text", - nullable: false, - oldClrType: typeof(string), - oldType: "character varying(450)", - oldMaxLength: 450); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260727041318_AddConfiguration.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260727041318_AddConfiguration.Designer.cs deleted file mode 100644 index f8ee460029..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260727041318_AddConfiguration.Designer.cs +++ /dev/null @@ -1,315 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260727041318_AddConfiguration")] - partial class AddConfiguration - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.Property("TrackInstances") - .HasColumnType("boolean") - .HasColumnName("track_instances"); - - b.HasKey("Name") - .HasName("pk_endpoint_settings"); - - b.ToTable("endpoint_settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FailingEndpointAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("failing_endpoint_address"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("QueueAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("queue_address"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("FailingEndpointAddress") - .HasDatabaseName("ix_failed_messages_failing_endpoint_address"); - - b.HasIndex("QueueAddress") - .HasDatabaseName("ix_failed_messages_queue_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date") - .HasColumnName("trial_end_date"); - - b.HasKey("Id") - .HasName("pk_trial_metadata"); - - b.ToTable("trial_metadata", (string)null); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260727041318_AddConfiguration.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260727041318_AddConfiguration.cs deleted file mode 100644 index 29a9cb61bc..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260727041318_AddConfiguration.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class AddConfiguration : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "failing_endpoint_address", - table: "failed_messages", - type: "character varying(450)", - maxLength: 450, - nullable: false, - defaultValue: ""); - - migrationBuilder.CreateTable( - name: "endpoint_settings", - columns: table => new - { - name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), - track_instances = table.Column(type: "boolean", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_endpoint_settings", x => x.name); - }); - - migrationBuilder.CreateTable( - name: "trial_metadata", - columns: table => new - { - id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - trial_end_date = table.Column(type: "date", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("pk_trial_metadata", x => x.id); - }); - - migrationBuilder.InsertData( - table: "trial_metadata", - columns: new[] { "id", "trial_end_date" }, - values: new object[] { 1, null }); - - migrationBuilder.CreateIndex( - name: "ix_failed_messages_failing_endpoint_address", - table: "failed_messages", - column: "failing_endpoint_address"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "endpoint_settings"); - - migrationBuilder.DropTable( - name: "trial_metadata"); - - migrationBuilder.DropIndex( - name: "ix_failed_messages_failing_endpoint_address", - table: "failed_messages"); - - migrationBuilder.DropColumn( - name: "failing_endpoint_address", - table: "failed_messages"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260728233024_AddFailedErrorImports.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260728233024_AddFailedErrorImports.Designer.cs deleted file mode 100644 index df07d97e7a..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260728233024_AddFailedErrorImports.Designer.cs +++ /dev/null @@ -1,359 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260728233024_AddFailedErrorImports")] - partial class AddFailedErrorImports - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.Property("TrackInstances") - .HasColumnType("boolean") - .HasColumnName("track_instances"); - - b.HasKey("Name") - .HasName("pk_endpoint_settings"); - - b.ToTable("endpoint_settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("Body") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("body"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("text") - .HasColumnName("exception_info"); - - b.Property("FailedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("failed_at"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_error_imports"); - - b.HasIndex("FailedAt") - .HasDatabaseName("ix_failed_error_imports_failed_at"); - - b.ToTable("failed_error_imports", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FailingEndpointAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("failing_endpoint_address"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("QueueAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("queue_address"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("FailingEndpointAddress") - .HasDatabaseName("ix_failed_messages_failing_endpoint_address"); - - b.HasIndex("QueueAddress") - .HasDatabaseName("ix_failed_messages_queue_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date") - .HasColumnName("trial_end_date"); - - b.HasKey("Id") - .HasName("pk_trial_metadata"); - - b.ToTable("trial_metadata", (string)null); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260728233024_AddFailedErrorImports.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260728233024_AddFailedErrorImports.cs deleted file mode 100644 index b0cbbbdaa6..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260728233024_AddFailedErrorImports.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class AddFailedErrorImports : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "failed_error_imports", - columns: table => new - { - unique_message_id = table.Column(type: "uuid", nullable: false), - failed_at = table.Column(type: "timestamp with time zone", nullable: false), - message_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), - headers_json = table.Column(type: "text", nullable: false), - body = table.Column(type: "bytea", nullable: false), - body_stored_externally = table.Column(type: "boolean", nullable: false), - exception_info = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_failed_error_imports", x => x.unique_message_id); - }); - - migrationBuilder.CreateIndex( - name: "ix_failed_error_imports_failed_at", - table: "failed_error_imports", - column: "failed_at"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "failed_error_imports"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260729053645_AddSubscriptions.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260729053645_AddSubscriptions.Designer.cs deleted file mode 100644 index 4feb704b4c..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260729053645_AddSubscriptions.Designer.cs +++ /dev/null @@ -1,383 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260729053645_AddSubscriptions")] - partial class AddSubscriptions - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.Property("TrackInstances") - .HasColumnType("boolean") - .HasColumnName("track_instances"); - - b.HasKey("Name") - .HasName("pk_endpoint_settings"); - - b.ToTable("endpoint_settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("Body") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("body"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("text") - .HasColumnName("exception_info"); - - b.Property("FailedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("failed_at"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_error_imports"); - - b.HasIndex("FailedAt") - .HasDatabaseName("ix_failed_error_imports_failed_at"); - - b.ToTable("failed_error_imports", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FailingEndpointAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("failing_endpoint_address"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("QueueAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("queue_address"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("FailingEndpointAddress") - .HasDatabaseName("ix_failed_messages_failing_endpoint_address"); - - b.HasIndex("QueueAddress") - .HasDatabaseName("ix_failed_messages_queue_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("message_type"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("transport_address"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("endpoint"); - - b.HasKey("MessageType", "TransportAddress") - .HasName("pk_subscriptions"); - - b.ToTable("subscriptions", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date") - .HasColumnName("trial_end_date"); - - b.HasKey("Id") - .HasName("pk_trial_metadata"); - - b.ToTable("trial_metadata", (string)null); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260729053645_AddSubscriptions.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260729053645_AddSubscriptions.cs deleted file mode 100644 index 18de802cd8..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260729053645_AddSubscriptions.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class AddSubscriptions : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "subscriptions", - columns: table => new - { - message_type = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), - transport_address = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), - endpoint = table.Column(type: "character varying(450)", maxLength: 450, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_subscriptions", x => new { x.message_type, x.transport_address }); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "subscriptions"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731003309_DropDuplicateQueueAddress.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731003309_DropDuplicateQueueAddress.Designer.cs deleted file mode 100644 index 7570ecd8f8..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731003309_DropDuplicateQueueAddress.Designer.cs +++ /dev/null @@ -1,375 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260731003309_DropDuplicateQueueAddress")] - partial class DropDuplicateQueueAddress - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.Property("TrackInstances") - .HasColumnType("boolean") - .HasColumnName("track_instances"); - - b.HasKey("Name") - .HasName("pk_endpoint_settings"); - - b.ToTable("endpoint_settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("Body") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("body"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("text") - .HasColumnName("exception_info"); - - b.Property("FailedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("failed_at"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_error_imports"); - - b.HasIndex("FailedAt") - .HasDatabaseName("ix_failed_error_imports_failed_at"); - - b.ToTable("failed_error_imports", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FailingEndpointAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("failing_endpoint_address"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("FailingEndpointAddress") - .HasDatabaseName("ix_failed_messages_failing_endpoint_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("message_type"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("transport_address"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("endpoint"); - - b.HasKey("MessageType", "TransportAddress") - .HasName("pk_subscriptions"); - - b.ToTable("subscriptions", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date") - .HasColumnName("trial_end_date"); - - b.HasKey("Id") - .HasName("pk_trial_metadata"); - - b.ToTable("trial_metadata", (string)null); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731003309_DropDuplicateQueueAddress.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731003309_DropDuplicateQueueAddress.cs deleted file mode 100644 index ee9c0704bc..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731003309_DropDuplicateQueueAddress.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class DropDuplicateQueueAddress : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "ix_failed_messages_queue_address", - table: "failed_messages"); - - migrationBuilder.DropColumn( - name: "queue_address", - table: "failed_messages"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "queue_address", - table: "failed_messages", - type: "character varying(450)", - maxLength: 450, - nullable: true); - - migrationBuilder.CreateIndex( - name: "ix_failed_messages_queue_address", - table: "failed_messages", - column: "queue_address"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731010357_EventLogItems.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731010357_EventLogItems.Designer.cs deleted file mode 100644 index a6ade62c6a..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731010357_EventLogItems.Designer.cs +++ /dev/null @@ -1,433 +0,0 @@ -// -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260731010357_EventLogItems")] - partial class EventLogItems - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.Property("TrackInstances") - .HasColumnType("boolean") - .HasColumnName("track_instances"); - - b.HasKey("Name") - .HasName("pk_endpoint_settings"); - - b.ToTable("endpoint_settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("category"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("event_type"); - - b.Property("RaisedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("raised_at"); - - b.PrimitiveCollection>("RelatedTo") - .IsRequired() - .HasColumnType("text[]") - .HasColumnName("related_to"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("pk_event_log_items"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending() - .HasDatabaseName("ix_event_log_items_raised_at_id"); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("Body") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("body"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("text") - .HasColumnName("exception_info"); - - b.Property("FailedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("failed_at"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_error_imports"); - - b.HasIndex("FailedAt") - .HasDatabaseName("ix_failed_error_imports_failed_at"); - - b.ToTable("failed_error_imports", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FailingEndpointAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("failing_endpoint_address"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("QueueAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("queue_address"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("FailingEndpointAddress") - .HasDatabaseName("ix_failed_messages_failing_endpoint_address"); - - b.HasIndex("QueueAddress") - .HasDatabaseName("ix_failed_messages_queue_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("message_type"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("transport_address"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("endpoint"); - - b.HasKey("MessageType", "TransportAddress") - .HasName("pk_subscriptions"); - - b.ToTable("subscriptions", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date") - .HasColumnName("trial_end_date"); - - b.HasKey("Id") - .HasName("pk_trial_metadata"); - - b.ToTable("trial_metadata", (string)null); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731010357_EventLogItems.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731010357_EventLogItems.cs deleted file mode 100644 index 5b7be41547..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731010357_EventLogItems.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class EventLogItems : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "EventLogItems", - columns: table => new - { - id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - description = table.Column(type: "text", nullable: false), - severity = table.Column(type: "integer", nullable: false), - raised_at = table.Column(type: "timestamp with time zone", nullable: false), - related_to = table.Column>(type: "text[]", nullable: false), - category = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), - event_type = table.Column(type: "character varying(450)", maxLength: 450, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_event_log_items", x => x.id); - }); - - migrationBuilder.CreateIndex( - name: "ix_event_log_items_raised_at_id", - table: "EventLogItems", - columns: new[] { "raised_at", "id" }, - descending: new bool[0]); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "EventLogItems"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731043221_AddFailureGroupClassifierIndex.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731043221_AddFailureGroupClassifierIndex.Designer.cs deleted file mode 100644 index 5ed94cb171..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731043221_AddFailureGroupClassifierIndex.Designer.cs +++ /dev/null @@ -1,378 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260731043221_AddFailureGroupClassifierIndex")] - partial class AddFailureGroupClassifierIndex - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.Property("TrackInstances") - .HasColumnType("boolean") - .HasColumnName("track_instances"); - - b.HasKey("Name") - .HasName("pk_endpoint_settings"); - - b.ToTable("endpoint_settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("Body") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("body"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("text") - .HasColumnName("exception_info"); - - b.Property("FailedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("failed_at"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_error_imports"); - - b.HasIndex("FailedAt") - .HasDatabaseName("ix_failed_error_imports_failed_at"); - - b.ToTable("failed_error_imports", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FailingEndpointAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("failing_endpoint_address"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("FailingEndpointAddress") - .HasDatabaseName("ix_failed_messages_failing_endpoint_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.HasIndex("Type", "GroupId") - .HasDatabaseName("ix_failed_message_groups_type_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("message_type"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("transport_address"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("endpoint"); - - b.HasKey("MessageType", "TransportAddress") - .HasName("pk_subscriptions"); - - b.ToTable("subscriptions", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date") - .HasColumnName("trial_end_date"); - - b.HasKey("Id") - .HasName("pk_trial_metadata"); - - b.ToTable("trial_metadata", (string)null); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731043221_AddFailureGroupClassifierIndex.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731043221_AddFailureGroupClassifierIndex.cs deleted file mode 100644 index f61b3ea87e..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731043221_AddFailureGroupClassifierIndex.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class AddFailureGroupClassifierIndex : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateIndex( - name: "ix_failed_message_groups_type_group_id", - table: "failed_message_groups", - columns: new[] { "type", "group_id" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "ix_failed_message_groups_type_group_id", - table: "failed_message_groups"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731043356_NullableEndpointAddress.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731043356_NullableEndpointAddress.Designer.cs deleted file mode 100644 index d470f88efd..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731043356_NullableEndpointAddress.Designer.cs +++ /dev/null @@ -1,432 +0,0 @@ -// -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260731043356_NullableEndpointAddress")] - partial class NullableEndpointAddress - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.Property("TrackInstances") - .HasColumnType("boolean") - .HasColumnName("track_instances"); - - b.HasKey("Name") - .HasName("pk_endpoint_settings"); - - b.ToTable("endpoint_settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("category"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("event_type"); - - b.Property("RaisedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("raised_at"); - - b.PrimitiveCollection>("RelatedTo") - .IsRequired() - .HasColumnType("text[]") - .HasColumnName("related_to"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("pk_event_log_items"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending() - .HasDatabaseName("ix_event_log_items_raised_at_id"); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("Body") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("body"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("text") - .HasColumnName("exception_info"); - - b.Property("FailedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("failed_at"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_error_imports"); - - b.HasIndex("FailedAt") - .HasDatabaseName("ix_failed_error_imports_failed_at"); - - b.ToTable("failed_error_imports", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("failing_endpoint_address"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("QueueAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("queue_address"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("FailingEndpointAddress") - .HasDatabaseName("ix_failed_messages_failing_endpoint_address"); - - b.HasIndex("QueueAddress") - .HasDatabaseName("ix_failed_messages_queue_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("message_type"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("transport_address"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("endpoint"); - - b.HasKey("MessageType", "TransportAddress") - .HasName("pk_subscriptions"); - - b.ToTable("subscriptions", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date") - .HasColumnName("trial_end_date"); - - b.HasKey("Id") - .HasName("pk_trial_metadata"); - - b.ToTable("trial_metadata", (string)null); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731043356_NullableEndpointAddress.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731043356_NullableEndpointAddress.cs deleted file mode 100644 index 31a2bf2c1a..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260731043356_NullableEndpointAddress.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class NullableEndpointAddress : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "failing_endpoint_address", - table: "failed_messages", - type: "character varying(450)", - maxLength: 450, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(450)", - oldMaxLength: 450); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "failing_endpoint_address", - table: "failed_messages", - type: "character varying(450)", - maxLength: 450, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(450)", - oldMaxLength: 450, - oldNullable: true); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260801000409_AddGroupComments.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260801000409_AddGroupComments.Designer.cs deleted file mode 100644 index 93d607c977..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260801000409_AddGroupComments.Designer.cs +++ /dev/null @@ -1,445 +0,0 @@ -// -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260801000409_AddGroupComments")] - partial class AddGroupComments - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.Property("TrackInstances") - .HasColumnType("boolean") - .HasColumnName("track_instances"); - - b.HasKey("Name") - .HasName("pk_endpoint_settings"); - - b.ToTable("endpoint_settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("category"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("event_type"); - - b.Property("RaisedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("raised_at"); - - b.PrimitiveCollection>("RelatedTo") - .IsRequired() - .HasColumnType("text[]") - .HasColumnName("related_to"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("pk_event_log_items"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending() - .HasDatabaseName("ix_event_log_items_raised_at_id"); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("Body") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("body"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("text") - .HasColumnName("exception_info"); - - b.Property("FailedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("failed_at"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_error_imports"); - - b.HasIndex("FailedAt") - .HasDatabaseName("ix_failed_error_imports_failed_at"); - - b.ToTable("failed_error_imports", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("failing_endpoint_address"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("FailingEndpointAddress") - .HasDatabaseName("ix_failed_messages_failing_endpoint_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.HasIndex("Type", "GroupId") - .HasDatabaseName("ix_failed_message_groups_type_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.GroupCommentEntity", b => - { - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("text") - .HasColumnName("comment"); - - b.HasKey("GroupId") - .HasName("pk_group_comments"); - - b.ToTable("group_comments", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("message_type"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("transport_address"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("endpoint"); - - b.HasKey("MessageType", "TransportAddress") - .HasName("pk_subscriptions"); - - b.ToTable("subscriptions", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date") - .HasColumnName("trial_end_date"); - - b.HasKey("Id") - .HasName("pk_trial_metadata"); - - b.ToTable("trial_metadata", (string)null); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260801000409_AddGroupComments.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260801000409_AddGroupComments.cs deleted file mode 100644 index a6c01c90f0..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260801000409_AddGroupComments.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class AddGroupComments : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "group_comments", - columns: table => new - { - group_id = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), - comment = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_group_comments", x => x.group_id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "group_comments"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260802023138_AddMessageRedirects.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260802023138_AddMessageRedirects.Designer.cs deleted file mode 100644 index 21184da174..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260802023138_AddMessageRedirects.Designer.cs +++ /dev/null @@ -1,468 +0,0 @@ -// -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260802023138_AddMessageRedirects")] - partial class AddMessageRedirects - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.Property("TrackInstances") - .HasColumnType("boolean") - .HasColumnName("track_instances"); - - b.HasKey("Name") - .HasName("pk_endpoint_settings"); - - b.ToTable("endpoint_settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("category"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("event_type"); - - b.Property("RaisedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("raised_at"); - - b.PrimitiveCollection>("RelatedTo") - .IsRequired() - .HasColumnType("text[]") - .HasColumnName("related_to"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("pk_event_log_items"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending() - .HasDatabaseName("ix_event_log_items_raised_at_id"); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("Body") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("body"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("text") - .HasColumnName("exception_info"); - - b.Property("FailedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("failed_at"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_error_imports"); - - b.HasIndex("FailedAt") - .HasDatabaseName("ix_failed_error_imports_failed_at"); - - b.ToTable("failed_error_imports", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("failing_endpoint_address"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("FailingEndpointAddress") - .HasDatabaseName("ix_failed_messages_failing_endpoint_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.HasIndex("Type", "GroupId") - .HasDatabaseName("ix_failed_message_groups_type_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.GroupCommentEntity", b => - { - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("text") - .HasColumnName("comment"); - - b.HasKey("GroupId") - .HasName("pk_group_comments"); - - b.ToTable("group_comments", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.MessageRedirectEntity", b => - { - b.Property("FromPhysicalAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("from_physical_address"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("ToPhysicalAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("to_physical_address"); - - b.HasKey("FromPhysicalAddress") - .HasName("pk_message_redirects"); - - b.ToTable("message_redirects", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("message_type"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("transport_address"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("endpoint"); - - b.HasKey("MessageType", "TransportAddress") - .HasName("pk_subscriptions"); - - b.ToTable("subscriptions", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date") - .HasColumnName("trial_end_date"); - - b.HasKey("Id") - .HasName("pk_trial_metadata"); - - b.ToTable("trial_metadata", (string)null); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260802023138_AddMessageRedirects.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260802023138_AddMessageRedirects.cs deleted file mode 100644 index 8e2888df78..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260802023138_AddMessageRedirects.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class AddMessageRedirects : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "message_redirects", - columns: table => new - { - from_physical_address = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), - to_physical_address = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), - last_modified = table.Column(type: "timestamp with time zone", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_message_redirects", x => x.from_physical_address); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "message_redirects"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260803021015_AddRetryBatches.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260803021015_AddRetryBatches.Designer.cs deleted file mode 100644 index 964f060ceb..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260803021015_AddRetryBatches.Designer.cs +++ /dev/null @@ -1,568 +0,0 @@ -// -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260803021015_AddRetryBatches")] - partial class AddRetryBatches - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.Property("TrackInstances") - .HasColumnType("boolean") - .HasColumnName("track_instances"); - - b.HasKey("Name") - .HasName("pk_endpoint_settings"); - - b.ToTable("endpoint_settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("category"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("event_type"); - - b.Property("RaisedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("raised_at"); - - b.PrimitiveCollection>("RelatedTo") - .IsRequired() - .HasColumnType("text[]") - .HasColumnName("related_to"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("pk_event_log_items"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending() - .HasDatabaseName("ix_event_log_items_raised_at_id"); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("Body") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("body"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("text") - .HasColumnName("exception_info"); - - b.Property("FailedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("failed_at"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_error_imports"); - - b.HasIndex("FailedAt") - .HasDatabaseName("ix_failed_error_imports_failed_at"); - - b.ToTable("failed_error_imports", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("failing_endpoint_address"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("FailingEndpointAddress") - .HasDatabaseName("ix_failed_messages_failing_endpoint_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.HasIndex("Type", "GroupId") - .HasDatabaseName("ix_failed_message_groups_type_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryBatchId") - .HasColumnType("uuid") - .HasColumnName("retry_batch_id"); - - b.Property("StageAttempts") - .HasColumnType("integer") - .HasColumnName("stage_attempts"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.HasIndex("RetryBatchId") - .HasDatabaseName("ix_failed_message_retries_retry_batch_id"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.GroupCommentEntity", b => - { - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("text") - .HasColumnName("comment"); - - b.HasKey("GroupId") - .HasName("pk_group_comments"); - - b.ToTable("group_comments", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.MessageRedirectEntity", b => - { - b.Property("FromPhysicalAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("from_physical_address"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("ToPhysicalAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("to_physical_address"); - - b.HasKey("FromPhysicalAddress") - .HasName("pk_message_redirects"); - - b.ToTable("message_redirects", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Classifier") - .HasColumnType("text") - .HasColumnName("classifier"); - - b.Property("Context") - .HasColumnType("text") - .HasColumnName("context"); - - b.Property("InitialBatchSize") - .HasColumnType("integer") - .HasColumnName("initial_batch_size"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("initiated_by_id"); - - b.Property("InitiatedByName") - .HasColumnType("text") - .HasColumnName("initiated_by_name"); - - b.Property("Last") - .HasColumnType("timestamp with time zone") - .HasColumnName("last"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("operation_id"); - - b.Property("Originator") - .HasColumnType("text") - .HasColumnName("originator"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("request_id"); - - b.Property("RetrySessionId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_session_id"); - - b.Property("RetryType") - .HasColumnType("integer") - .HasColumnName("retry_type"); - - b.Property("StagingId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("staging_id"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_time"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.HasKey("Id") - .HasName("pk_retry_batches"); - - b.HasIndex("Status", "RetrySessionId") - .HasDatabaseName("ix_retry_batches_status_retry_session_id"); - - b.ToTable("retry_batches", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchNowForwardingEntity", b => - { - b.Property("Id") - .HasColumnType("integer") - .HasColumnName("id"); - - b.Property("RetryBatchId") - .HasColumnType("uuid") - .HasColumnName("retry_batch_id"); - - b.HasKey("Id") - .HasName("pk_retry_batch_now_forwarding"); - - b.ToTable("retry_batch_now_forwarding", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("message_type"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("transport_address"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("endpoint"); - - b.HasKey("MessageType", "TransportAddress") - .HasName("pk_subscriptions"); - - b.ToTable("subscriptions", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date") - .HasColumnName("trial_end_date"); - - b.HasKey("Id") - .HasName("pk_trial_metadata"); - - b.ToTable("trial_metadata", (string)null); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260803021015_AddRetryBatches.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260803021015_AddRetryBatches.cs deleted file mode 100644 index 13fcc9c8ae..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260803021015_AddRetryBatches.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class AddRetryBatches : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "retry_id", - table: "failed_message_retries"); - - migrationBuilder.AddColumn( - name: "retry_batch_id", - table: "failed_message_retries", - type: "uuid", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AddColumn( - name: "stage_attempts", - table: "failed_message_retries", - type: "integer", - nullable: false, - defaultValue: 0); - - migrationBuilder.CreateTable( - name: "retry_batch_now_forwarding", - columns: table => new - { - id = table.Column(type: "integer", nullable: false), - retry_batch_id = table.Column(type: "uuid", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_retry_batch_now_forwarding", x => x.id); - }); - - migrationBuilder.CreateTable( - name: "retry_batches", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - status = table.Column(type: "integer", nullable: false), - retry_session_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), - request_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), - retry_type = table.Column(type: "integer", nullable: false), - initial_batch_size = table.Column(type: "integer", nullable: false), - start_time = table.Column(type: "timestamp with time zone", nullable: false), - last = table.Column(type: "timestamp with time zone", nullable: true), - staging_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), - context = table.Column(type: "text", nullable: true), - originator = table.Column(type: "text", nullable: true), - classifier = table.Column(type: "text", nullable: true), - initiated_by_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), - initiated_by_name = table.Column(type: "text", nullable: true), - operation_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("pk_retry_batches", x => x.id); - }); - - migrationBuilder.CreateIndex( - name: "ix_failed_message_retries_retry_batch_id", - table: "failed_message_retries", - column: "retry_batch_id"); - - migrationBuilder.CreateIndex( - name: "ix_retry_batches_status_retry_session_id", - table: "retry_batches", - columns: new[] { "status", "retry_session_id" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "retry_batch_now_forwarding"); - - migrationBuilder.DropTable( - name: "retry_batches"); - - migrationBuilder.DropIndex( - name: "ix_failed_message_retries_retry_batch_id", - table: "failed_message_retries"); - - migrationBuilder.DropColumn( - name: "retry_batch_id", - table: "failed_message_retries"); - - migrationBuilder.DropColumn( - name: "stage_attempts", - table: "failed_message_retries"); - - migrationBuilder.AddColumn( - name: "retry_id", - table: "failed_message_retries", - type: "character varying(450)", - maxLength: 450, - nullable: true); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260804052012_AddArchiveEntities.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260804052012_AddArchiveEntities.Designer.cs deleted file mode 100644 index eb43ef1626..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260804052012_AddArchiveEntities.Designer.cs +++ /dev/null @@ -1,686 +0,0 @@ -// -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260804052012_AddArchiveEntities")] - partial class AddArchiveEntities - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.ArchiveOperationEntity", b => - { - b.Property("RequestId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("request_id"); - - b.Property("ArchiveType") - .HasColumnType("integer") - .HasColumnName("archive_type"); - - b.Property("OperationType") - .HasColumnType("integer") - .HasColumnName("operation_type"); - - b.Property("CurrentBatch") - .HasColumnType("integer") - .HasColumnName("current_batch"); - - b.Property("GroupName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("group_name"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("initiated_by_id"); - - b.Property("InitiatedByName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("initiated_by_name"); - - b.Property("NumberOfBatches") - .HasColumnType("integer") - .HasColumnName("number_of_batches"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("integer") - .HasColumnName("number_of_messages_processed"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("operation_id"); - - b.Property("Started") - .HasColumnType("timestamp with time zone") - .HasColumnName("started"); - - b.Property("TotalNumberOfMessages") - .HasColumnType("integer") - .HasColumnName("total_number_of_messages"); - - b.HasKey("RequestId", "ArchiveType", "OperationType") - .HasName("pk_archive_operations"); - - b.HasIndex("Started") - .HasDatabaseName("ix_archive_operations_started"); - - b.ToTable("archive_operations", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.CustomCheckEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Category") - .IsRequired() - .HasColumnType("text") - .HasColumnName("category"); - - b.Property("CustomCheckId") - .IsRequired() - .HasColumnType("text") - .HasColumnName("custom_check_id"); - - b.Property("FailureReason") - .HasColumnType("text") - .HasColumnName("failure_reason"); - - b.Property("OriginatingEndpointHost") - .IsRequired() - .HasColumnType("text") - .HasColumnName("originating_endpoint_host"); - - b.Property("OriginatingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("originating_endpoint_host_id"); - - b.Property("OriginatingEndpointName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("originating_endpoint_name"); - - b.Property("ReportedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("reported_at"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.HasKey("Id") - .HasName("pk_custom_checks"); - - b.HasIndex("ReportedAt") - .HasDatabaseName("ix_custom_checks_reported_at"); - - b.HasIndex("Status", "ReportedAt") - .HasDatabaseName("ix_custom_checks_status_reported_at"); - - b.ToTable("custom_checks", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.Property("TrackInstances") - .HasColumnType("boolean") - .HasColumnName("track_instances"); - - b.HasKey("Name") - .HasName("pk_endpoint_settings"); - - b.ToTable("endpoint_settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("category"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("event_type"); - - b.Property("RaisedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("raised_at"); - - b.PrimitiveCollection>("RelatedTo") - .IsRequired() - .HasColumnType("text[]") - .HasColumnName("related_to"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("pk_event_log_items"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending() - .HasDatabaseName("ix_event_log_items_raised_at_id"); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("Body") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("body"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("text") - .HasColumnName("exception_info"); - - b.Property("FailedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("failed_at"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_error_imports"); - - b.HasIndex("FailedAt") - .HasDatabaseName("ix_failed_error_imports_failed_at"); - - b.ToTable("failed_error_imports", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("failing_endpoint_address"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("FailingEndpointAddress") - .HasDatabaseName("ix_failed_messages_failing_endpoint_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.HasIndex("Type", "GroupId") - .HasDatabaseName("ix_failed_message_groups_type_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryBatchId") - .HasColumnType("uuid") - .HasColumnName("retry_batch_id"); - - b.Property("StageAttempts") - .HasColumnType("integer") - .HasColumnName("stage_attempts"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.HasIndex("RetryBatchId") - .HasDatabaseName("ix_failed_message_retries_retry_batch_id"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.GroupCommentEntity", b => - { - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("text") - .HasColumnName("comment"); - - b.HasKey("GroupId") - .HasName("pk_group_comments"); - - b.ToTable("group_comments", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.MessageRedirectEntity", b => - { - b.Property("FromPhysicalAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("from_physical_address"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("ToPhysicalAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("to_physical_address"); - - b.HasKey("FromPhysicalAddress") - .HasName("pk_message_redirects"); - - b.ToTable("message_redirects", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Classifier") - .HasColumnType("text") - .HasColumnName("classifier"); - - b.Property("Context") - .HasColumnType("text") - .HasColumnName("context"); - - b.Property("InitialBatchSize") - .HasColumnType("integer") - .HasColumnName("initial_batch_size"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("initiated_by_id"); - - b.Property("InitiatedByName") - .HasColumnType("text") - .HasColumnName("initiated_by_name"); - - b.Property("Last") - .HasColumnType("timestamp with time zone") - .HasColumnName("last"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("operation_id"); - - b.Property("Originator") - .HasColumnType("text") - .HasColumnName("originator"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("request_id"); - - b.Property("RetrySessionId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_session_id"); - - b.Property("RetryType") - .HasColumnType("integer") - .HasColumnName("retry_type"); - - b.Property("StagingId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("staging_id"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_time"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.HasKey("Id") - .HasName("pk_retry_batches"); - - b.HasIndex("Status", "RetrySessionId") - .HasDatabaseName("ix_retry_batches_status_retry_session_id"); - - b.ToTable("retry_batches", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchNowForwardingEntity", b => - { - b.Property("Id") - .HasColumnType("integer") - .HasColumnName("id"); - - b.Property("RetryBatchId") - .HasColumnType("uuid") - .HasColumnName("retry_batch_id"); - - b.HasKey("Id") - .HasName("pk_retry_batch_now_forwarding"); - - b.ToTable("retry_batch_now_forwarding", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("message_type"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("transport_address"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("endpoint"); - - b.HasKey("MessageType", "TransportAddress") - .HasName("pk_subscriptions"); - - b.ToTable("subscriptions", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date") - .HasColumnName("trial_end_date"); - - b.HasKey("Id") - .HasName("pk_trial_metadata"); - - b.ToTable("trial_metadata", (string)null); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260804052012_AddArchiveEntities.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260804052012_AddArchiveEntities.cs deleted file mode 100644 index fc11707147..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260804052012_AddArchiveEntities.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class AddArchiveEntities : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "archive_operations", - columns: table => new - { - request_id = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), - archive_type = table.Column(type: "integer", nullable: false), - operation_type = table.Column(type: "integer", nullable: false), - group_name = table.Column(type: "text", nullable: false), - total_number_of_messages = table.Column(type: "integer", nullable: false), - number_of_messages_processed = table.Column(type: "integer", nullable: false), - number_of_batches = table.Column(type: "integer", nullable: false), - current_batch = table.Column(type: "integer", nullable: false), - started = table.Column(type: "timestamp with time zone", nullable: false), - initiated_by_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), - initiated_by_name = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), - operation_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("pk_archive_operations", x => new { x.request_id, x.archive_type, x.operation_type }); - }); - - migrationBuilder.CreateTable( - name: "custom_checks", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - custom_check_id = table.Column(type: "text", nullable: false), - category = table.Column(type: "text", nullable: false), - status = table.Column(type: "integer", nullable: false), - reported_at = table.Column(type: "timestamp with time zone", nullable: false), - failure_reason = table.Column(type: "text", nullable: true), - originating_endpoint_name = table.Column(type: "text", nullable: false), - originating_endpoint_host_id = table.Column(type: "uuid", nullable: false), - originating_endpoint_host = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_custom_checks", x => x.id); - }); - - migrationBuilder.CreateIndex( - name: "ix_archive_operations_started", - table: "archive_operations", - column: "started"); - - migrationBuilder.CreateIndex( - name: "ix_custom_checks_reported_at", - table: "custom_checks", - column: "reported_at"); - - migrationBuilder.CreateIndex( - name: "ix_custom_checks_status_reported_at", - table: "custom_checks", - columns: new[] { "status", "reported_at" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "archive_operations"); - - migrationBuilder.DropTable( - name: "custom_checks"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260804222120_AddRetryHistory.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260804222120_AddRetryHistory.Designer.cs deleted file mode 100644 index 4bb68b0a7b..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260804222120_AddRetryHistory.Designer.cs +++ /dev/null @@ -1,717 +0,0 @@ -// -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260804222120_AddRetryHistory")] - partial class AddRetryHistory - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.CustomCheckEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Category") - .IsRequired() - .HasColumnType("text") - .HasColumnName("category"); - - b.Property("CustomCheckId") - .IsRequired() - .HasColumnType("text") - .HasColumnName("custom_check_id"); - - b.Property("FailureReason") - .HasColumnType("text") - .HasColumnName("failure_reason"); - - b.Property("OriginatingEndpointHost") - .IsRequired() - .HasColumnType("text") - .HasColumnName("originating_endpoint_host"); - - b.Property("OriginatingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("originating_endpoint_host_id"); - - b.Property("OriginatingEndpointName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("originating_endpoint_name"); - - b.Property("ReportedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("reported_at"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.HasKey("Id") - .HasName("pk_custom_checks"); - - b.HasIndex("ReportedAt") - .HasDatabaseName("ix_custom_checks_reported_at"); - - b.HasIndex("Status", "ReportedAt") - .HasDatabaseName("ix_custom_checks_status_reported_at"); - - b.ToTable("custom_checks", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.Property("TrackInstances") - .HasColumnType("boolean") - .HasColumnName("track_instances"); - - b.HasKey("Name") - .HasName("pk_endpoint_settings"); - - b.ToTable("endpoint_settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("category"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("event_type"); - - b.Property("RaisedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("raised_at"); - - b.PrimitiveCollection>("RelatedTo") - .IsRequired() - .HasColumnType("text[]") - .HasColumnName("related_to"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("pk_event_log_items"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending() - .HasDatabaseName("ix_event_log_items_raised_at_id"); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("Body") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("body"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("text") - .HasColumnName("exception_info"); - - b.Property("FailedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("failed_at"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_error_imports"); - - b.HasIndex("FailedAt") - .HasDatabaseName("ix_failed_error_imports_failed_at"); - - b.ToTable("failed_error_imports", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("failing_endpoint_address"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("FailingEndpointAddress") - .HasDatabaseName("ix_failed_messages_failing_endpoint_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.HasIndex("Type", "GroupId") - .HasDatabaseName("ix_failed_message_groups_type_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryBatchId") - .HasColumnType("uuid") - .HasColumnName("retry_batch_id"); - - b.Property("StageAttempts") - .HasColumnType("integer") - .HasColumnName("stage_attempts"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.HasIndex("RetryBatchId") - .HasDatabaseName("ix_failed_message_retries_retry_batch_id"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.GroupCommentEntity", b => - { - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("text") - .HasColumnName("comment"); - - b.HasKey("GroupId") - .HasName("pk_group_comments"); - - b.ToTable("group_comments", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.HistoricRetryOperationEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("completion_time"); - - b.Property("Failed") - .HasColumnType("boolean") - .HasColumnName("failed"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("integer") - .HasColumnName("number_of_messages_processed"); - - b.Property("Originator") - .HasColumnType("text") - .HasColumnName("originator"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(400) - .HasColumnType("character varying(400)") - .HasColumnName("request_id"); - - b.Property("RetryType") - .HasColumnType("integer") - .HasColumnName("retry_type"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_time"); - - b.HasKey("Id") - .HasName("pk_historic_retry_operations"); - - b.HasIndex("CompletionTime", "Id") - .IsDescending() - .HasDatabaseName("ix_historic_retry_operations_completion_time_id"); - - b.ToTable("historic_retry_operations", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.MessageRedirectEntity", b => - { - b.Property("FromPhysicalAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("from_physical_address"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("ToPhysicalAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("to_physical_address"); - - b.HasKey("FromPhysicalAddress") - .HasName("pk_message_redirects"); - - b.ToTable("message_redirects", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Classifier") - .HasColumnType("text") - .HasColumnName("classifier"); - - b.Property("Context") - .HasColumnType("text") - .HasColumnName("context"); - - b.Property("InitialBatchSize") - .HasColumnType("integer") - .HasColumnName("initial_batch_size"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("initiated_by_id"); - - b.Property("InitiatedByName") - .HasColumnType("text") - .HasColumnName("initiated_by_name"); - - b.Property("Last") - .HasColumnType("timestamp with time zone") - .HasColumnName("last"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("operation_id"); - - b.Property("Originator") - .HasColumnType("text") - .HasColumnName("originator"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("request_id"); - - b.Property("RetrySessionId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_session_id"); - - b.Property("RetryType") - .HasColumnType("integer") - .HasColumnName("retry_type"); - - b.Property("StagingId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("staging_id"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_time"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.HasKey("Id") - .HasName("pk_retry_batches"); - - b.HasIndex("Status", "RetrySessionId") - .HasDatabaseName("ix_retry_batches_status_retry_session_id"); - - b.ToTable("retry_batches", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchNowForwardingEntity", b => - { - b.Property("Id") - .HasColumnType("integer") - .HasColumnName("id"); - - b.Property("RetryBatchId") - .HasColumnType("uuid") - .HasColumnName("retry_batch_id"); - - b.HasKey("Id") - .HasName("pk_retry_batch_now_forwarding"); - - b.ToTable("retry_batch_now_forwarding", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("message_type"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("transport_address"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("endpoint"); - - b.HasKey("MessageType", "TransportAddress") - .HasName("pk_subscriptions"); - - b.ToTable("subscriptions", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date") - .HasColumnName("trial_end_date"); - - b.HasKey("Id") - .HasName("pk_trial_metadata"); - - b.ToTable("trial_metadata", (string)null); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.UnacknowledgedRetryOperationEntity", b => - { - b.Property("RequestId") - .HasMaxLength(400) - .HasColumnType("character varying(400)") - .HasColumnName("request_id"); - - b.Property("RetryType") - .HasColumnType("integer") - .HasColumnName("retry_type"); - - b.Property("Classifier") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("classifier"); - - b.Property("CompletionTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("completion_time"); - - b.Property("Failed") - .HasColumnType("boolean") - .HasColumnName("failed"); - - b.Property("Last") - .HasColumnType("timestamp with time zone") - .HasColumnName("last"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("integer") - .HasColumnName("number_of_messages_processed"); - - b.Property("Originator") - .HasColumnType("text") - .HasColumnName("originator"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_time"); - - b.HasKey("RequestId", "RetryType") - .HasName("pk_unacknowledged_retry_operations"); - - b.ToTable("unacknowledged_retry_operations", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260804222120_AddRetryHistory.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260804222120_AddRetryHistory.cs deleted file mode 100644 index 3d2ba5f304..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260804222120_AddRetryHistory.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class AddRetryHistory : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "historic_retry_operations", - columns: table => new - { - id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - request_id = table.Column(type: "character varying(400)", maxLength: 400, nullable: false), - retry_type = table.Column(type: "integer", nullable: false), - start_time = table.Column(type: "timestamp with time zone", nullable: false), - completion_time = table.Column(type: "timestamp with time zone", nullable: false), - originator = table.Column(type: "text", nullable: true), - failed = table.Column(type: "boolean", nullable: false), - number_of_messages_processed = table.Column(type: "integer", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_historic_retry_operations", x => x.id); - }); - - migrationBuilder.CreateTable( - name: "unacknowledged_retry_operations", - columns: table => new - { - request_id = table.Column(type: "character varying(400)", maxLength: 400, nullable: false), - retry_type = table.Column(type: "integer", nullable: false), - start_time = table.Column(type: "timestamp with time zone", nullable: false), - completion_time = table.Column(type: "timestamp with time zone", nullable: false), - last = table.Column(type: "timestamp with time zone", nullable: false), - originator = table.Column(type: "text", nullable: true), - classifier = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), - failed = table.Column(type: "boolean", nullable: false), - number_of_messages_processed = table.Column(type: "integer", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_unacknowledged_retry_operations", x => new { x.request_id, x.retry_type }); - }); - - migrationBuilder.CreateIndex( - name: "ix_historic_retry_operations_completion_time_id", - table: "historic_retry_operations", - columns: new[] { "completion_time", "id" }, - descending: new bool[0]); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "historic_retry_operations"); - - migrationBuilder.DropTable( - name: "unacknowledged_retry_operations"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260807012019_AddSettings.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260807012019_AddSettings.Designer.cs deleted file mode 100644 index 19f1fae987..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260807012019_AddSettings.Designer.cs +++ /dev/null @@ -1,774 +0,0 @@ -// -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260807012019_AddSettings")] - partial class AddSettings - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.ArchiveOperationEntity", b => - { - b.Property("RequestId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("request_id"); - - b.Property("ArchiveType") - .HasColumnType("integer") - .HasColumnName("archive_type"); - - b.Property("OperationType") - .HasColumnType("integer") - .HasColumnName("operation_type"); - - b.Property("CurrentBatch") - .HasColumnType("integer") - .HasColumnName("current_batch"); - - b.Property("GroupName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("group_name"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("initiated_by_id"); - - b.Property("InitiatedByName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("initiated_by_name"); - - b.Property("NumberOfBatches") - .HasColumnType("integer") - .HasColumnName("number_of_batches"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("integer") - .HasColumnName("number_of_messages_processed"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("operation_id"); - - b.Property("Started") - .HasColumnType("timestamp with time zone") - .HasColumnName("started"); - - b.Property("TotalNumberOfMessages") - .HasColumnType("integer") - .HasColumnName("total_number_of_messages"); - - b.HasKey("RequestId", "ArchiveType", "OperationType") - .HasName("pk_archive_operations"); - - b.HasIndex("Started") - .HasDatabaseName("ix_archive_operations_started"); - - b.ToTable("archive_operations", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.CustomCheckEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Category") - .IsRequired() - .HasColumnType("text") - .HasColumnName("category"); - - b.Property("CustomCheckId") - .IsRequired() - .HasColumnType("text") - .HasColumnName("custom_check_id"); - - b.Property("FailureReason") - .HasColumnType("text") - .HasColumnName("failure_reason"); - - b.Property("OriginatingEndpointHost") - .IsRequired() - .HasColumnType("text") - .HasColumnName("originating_endpoint_host"); - - b.Property("OriginatingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("originating_endpoint_host_id"); - - b.Property("OriginatingEndpointName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("originating_endpoint_name"); - - b.Property("ReportedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("reported_at"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.HasKey("Id") - .HasName("pk_custom_checks"); - - b.HasIndex("ReportedAt") - .HasDatabaseName("ix_custom_checks_reported_at"); - - b.HasIndex("Status", "ReportedAt") - .HasDatabaseName("ix_custom_checks_status_reported_at"); - - b.ToTable("custom_checks", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.Property("TrackInstances") - .HasColumnType("boolean") - .HasColumnName("track_instances"); - - b.HasKey("Name") - .HasName("pk_endpoint_settings"); - - b.ToTable("endpoint_settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("category"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("event_type"); - - b.Property("RaisedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("raised_at"); - - b.PrimitiveCollection>("RelatedTo") - .IsRequired() - .HasColumnType("text[]") - .HasColumnName("related_to"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("pk_event_log_items"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending() - .HasDatabaseName("ix_event_log_items_raised_at_id"); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("Body") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("body"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("text") - .HasColumnName("exception_info"); - - b.Property("FailedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("failed_at"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_error_imports"); - - b.HasIndex("FailedAt") - .HasDatabaseName("ix_failed_error_imports_failed_at"); - - b.ToTable("failed_error_imports", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("failing_endpoint_address"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("FailingEndpointAddress") - .HasDatabaseName("ix_failed_messages_failing_endpoint_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.HasIndex("Type", "GroupId") - .HasDatabaseName("ix_failed_message_groups_type_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryBatchId") - .HasColumnType("uuid") - .HasColumnName("retry_batch_id"); - - b.Property("StageAttempts") - .HasColumnType("integer") - .HasColumnName("stage_attempts"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.HasIndex("RetryBatchId") - .HasDatabaseName("ix_failed_message_retries_retry_batch_id"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.GroupCommentEntity", b => - { - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("text") - .HasColumnName("comment"); - - b.HasKey("GroupId") - .HasName("pk_group_comments"); - - b.ToTable("group_comments", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.HistoricRetryOperationEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("completion_time"); - - b.Property("Failed") - .HasColumnType("boolean") - .HasColumnName("failed"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("integer") - .HasColumnName("number_of_messages_processed"); - - b.Property("Originator") - .HasColumnType("text") - .HasColumnName("originator"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(400) - .HasColumnType("character varying(400)") - .HasColumnName("request_id"); - - b.Property("RetryType") - .HasColumnType("integer") - .HasColumnName("retry_type"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_time"); - - b.HasKey("Id") - .HasName("pk_historic_retry_operations"); - - b.HasIndex("CompletionTime", "Id") - .IsDescending() - .HasDatabaseName("ix_historic_retry_operations_completion_time_id"); - - b.ToTable("historic_retry_operations", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.MessageRedirectEntity", b => - { - b.Property("FromPhysicalAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("from_physical_address"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("ToPhysicalAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("to_physical_address"); - - b.HasKey("FromPhysicalAddress") - .HasName("pk_message_redirects"); - - b.ToTable("message_redirects", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Classifier") - .HasColumnType("text") - .HasColumnName("classifier"); - - b.Property("Context") - .HasColumnType("text") - .HasColumnName("context"); - - b.Property("InitialBatchSize") - .HasColumnType("integer") - .HasColumnName("initial_batch_size"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("initiated_by_id"); - - b.Property("InitiatedByName") - .HasColumnType("text") - .HasColumnName("initiated_by_name"); - - b.Property("Last") - .HasColumnType("timestamp with time zone") - .HasColumnName("last"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("operation_id"); - - b.Property("Originator") - .HasColumnType("text") - .HasColumnName("originator"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("request_id"); - - b.Property("RetrySessionId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_session_id"); - - b.Property("RetryType") - .HasColumnType("integer") - .HasColumnName("retry_type"); - - b.Property("StagingId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("staging_id"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_time"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.HasKey("Id") - .HasName("pk_retry_batches"); - - b.HasIndex("Status", "RetrySessionId") - .HasDatabaseName("ix_retry_batches_status_retry_session_id"); - - b.ToTable("retry_batches", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchNowForwardingEntity", b => - { - b.Property("Id") - .HasColumnType("integer") - .HasColumnName("id"); - - b.Property("RetryBatchId") - .HasColumnType("uuid") - .HasColumnName("retry_batch_id"); - - b.HasKey("Id") - .HasName("pk_retry_batch_now_forwarding"); - - b.ToTable("retry_batch_now_forwarding", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SettingEntity", b => - { - b.Property("Key") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("key"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text") - .HasColumnName("value"); - - b.HasKey("Key") - .HasName("pk_settings"); - - b.ToTable("settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("message_type"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("transport_address"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("endpoint"); - - b.HasKey("MessageType", "TransportAddress") - .HasName("pk_subscriptions"); - - b.ToTable("subscriptions", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.UnacknowledgedRetryOperationEntity", b => - { - b.Property("RequestId") - .HasMaxLength(400) - .HasColumnType("character varying(400)") - .HasColumnName("request_id"); - - b.Property("RetryType") - .HasColumnType("integer") - .HasColumnName("retry_type"); - - b.Property("Classifier") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("classifier"); - - b.Property("CompletionTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("completion_time"); - - b.Property("Failed") - .HasColumnType("boolean") - .HasColumnName("failed"); - - b.Property("Last") - .HasColumnType("timestamp with time zone") - .HasColumnName("last"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("integer") - .HasColumnName("number_of_messages_processed"); - - b.Property("Originator") - .HasColumnType("text") - .HasColumnName("originator"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_time"); - - b.HasKey("RequestId", "RetryType") - .HasName("pk_unacknowledged_retry_operations"); - - b.ToTable("unacknowledged_retry_operations", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260807012019_AddSettings.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260807012019_AddSettings.cs deleted file mode 100644 index 1ffdcc3b42..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260807012019_AddSettings.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class AddSettings : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "trial_metadata"); - - migrationBuilder.CreateTable( - name: "settings", - columns: table => new - { - key = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), - value = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_settings", x => x.key); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "settings"); - - migrationBuilder.CreateTable( - name: "trial_metadata", - columns: table => new - { - id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - trial_end_date = table.Column(type: "date", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("pk_trial_metadata", x => x.id); - }); - - migrationBuilder.InsertData( - table: "trial_metadata", - columns: new[] { "id", "trial_end_date" }, - values: new object[] { 1, null }); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260807053832_AddLicensingThroughput.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260807053832_AddLicensingThroughput.Designer.cs deleted file mode 100644 index d2995c6c11..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260807053832_AddLicensingThroughput.Designer.cs +++ /dev/null @@ -1,866 +0,0 @@ -// -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260807053832_AddLicensingThroughput")] - partial class AddLicensingThroughput - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.ArchiveOperationEntity", b => - { - b.Property("RequestId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("request_id"); - - b.Property("ArchiveType") - .HasColumnType("integer") - .HasColumnName("archive_type"); - - b.Property("OperationType") - .HasColumnType("integer") - .HasColumnName("operation_type"); - - b.Property("CurrentBatch") - .HasColumnType("integer") - .HasColumnName("current_batch"); - - b.Property("GroupName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("group_name"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("initiated_by_id"); - - b.Property("InitiatedByName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("initiated_by_name"); - - b.Property("NumberOfBatches") - .HasColumnType("integer") - .HasColumnName("number_of_batches"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("integer") - .HasColumnName("number_of_messages_processed"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("operation_id"); - - b.Property("Started") - .HasColumnType("timestamp with time zone") - .HasColumnName("started"); - - b.Property("TotalNumberOfMessages") - .HasColumnType("integer") - .HasColumnName("total_number_of_messages"); - - b.HasKey("RequestId", "ArchiveType", "OperationType") - .HasName("pk_archive_operations"); - - b.HasIndex("Started") - .HasDatabaseName("ix_archive_operations_started"); - - b.ToTable("archive_operations", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.CustomCheckEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Category") - .IsRequired() - .HasColumnType("text") - .HasColumnName("category"); - - b.Property("CustomCheckId") - .IsRequired() - .HasColumnType("text") - .HasColumnName("custom_check_id"); - - b.Property("FailureReason") - .HasColumnType("text") - .HasColumnName("failure_reason"); - - b.Property("OriginatingEndpointHost") - .IsRequired() - .HasColumnType("text") - .HasColumnName("originating_endpoint_host"); - - b.Property("OriginatingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("originating_endpoint_host_id"); - - b.Property("OriginatingEndpointName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("originating_endpoint_name"); - - b.Property("ReportedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("reported_at"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.HasKey("Id") - .HasName("pk_custom_checks"); - - b.HasIndex("ReportedAt") - .HasDatabaseName("ix_custom_checks_reported_at"); - - b.HasIndex("Status", "ReportedAt") - .HasDatabaseName("ix_custom_checks_status_reported_at"); - - b.ToTable("custom_checks", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.Property("TrackInstances") - .HasColumnType("boolean") - .HasColumnName("track_instances"); - - b.HasKey("Name") - .HasName("pk_endpoint_settings"); - - b.ToTable("endpoint_settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("category"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("event_type"); - - b.Property("RaisedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("raised_at"); - - b.PrimitiveCollection>("RelatedTo") - .IsRequired() - .HasColumnType("text[]") - .HasColumnName("related_to"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("pk_event_log_items"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending() - .HasDatabaseName("ix_event_log_items_raised_at_id"); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("Body") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("body"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("text") - .HasColumnName("exception_info"); - - b.Property("FailedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("failed_at"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_error_imports"); - - b.HasIndex("FailedAt") - .HasDatabaseName("ix_failed_error_imports_failed_at"); - - b.ToTable("failed_error_imports", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("failing_endpoint_address"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("FailingEndpointAddress") - .HasDatabaseName("ix_failed_messages_failing_endpoint_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.HasIndex("Type", "GroupId") - .HasDatabaseName("ix_failed_message_groups_type_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryBatchId") - .HasColumnType("uuid") - .HasColumnName("retry_batch_id"); - - b.Property("StageAttempts") - .HasColumnType("integer") - .HasColumnName("stage_attempts"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.HasIndex("RetryBatchId") - .HasDatabaseName("ix_failed_message_retries_retry_batch_id"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.GroupCommentEntity", b => - { - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("text") - .HasColumnName("comment"); - - b.HasKey("GroupId") - .HasName("pk_group_comments"); - - b.ToTable("group_comments", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.HistoricRetryOperationEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("completion_time"); - - b.Property("Failed") - .HasColumnType("boolean") - .HasColumnName("failed"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("integer") - .HasColumnName("number_of_messages_processed"); - - b.Property("Originator") - .HasColumnType("text") - .HasColumnName("originator"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(400) - .HasColumnType("character varying(400)") - .HasColumnName("request_id"); - - b.Property("RetryType") - .HasColumnType("integer") - .HasColumnName("retry_type"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_time"); - - b.HasKey("Id") - .HasName("pk_historic_retry_operations"); - - b.HasIndex("CompletionTime", "Id") - .IsDescending() - .HasDatabaseName("ix_historic_retry_operations_completion_time_id"); - - b.ToTable("historic_retry_operations", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.LicensingEndpointEntity", b => - { - b.Property("NormalizedName") - .HasMaxLength(300) - .HasColumnType("character varying(300)") - .HasColumnName("normalized_name"); - - b.Property("ThroughputSource") - .HasColumnType("integer") - .HasColumnName("throughput_source"); - - b.PrimitiveCollection>("EndpointIndicators") - .IsRequired() - .HasColumnType("text[]") - .HasColumnName("endpoint_indicators"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)") - .HasColumnName("name"); - - b.Property("NormalizedSanitizedName") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("normalized_sanitized_name"); - - b.Property("SanitizedName") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sanitized_name"); - - b.Property("Scope") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("scope"); - - b.Property("UserIndicator") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("user_indicator"); - - b.HasKey("NormalizedName", "ThroughputSource") - .HasName("pk_licensing_endpoints"); - - b.HasIndex("NormalizedSanitizedName") - .HasDatabaseName("ix_licensing_endpoints_normalized_sanitized_name"); - - b.ToTable("licensing_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.LicensingEndpointThroughputEntity", b => - { - b.Property("NormalizedName") - .HasMaxLength(300) - .HasColumnType("character varying(300)") - .HasColumnName("normalized_name"); - - b.Property("ThroughputSource") - .HasColumnType("integer") - .HasColumnName("throughput_source"); - - b.Property("DateUtc") - .HasColumnType("date") - .HasColumnName("date_utc"); - - b.Property("MessageCount") - .HasColumnType("bigint") - .HasColumnName("message_count"); - - b.HasKey("NormalizedName", "ThroughputSource", "DateUtc") - .HasName("pk_licensing_endpoint_throughput"); - - b.HasIndex("DateUtc") - .HasDatabaseName("ix_licensing_endpoint_throughput_date_utc"); - - b.ToTable("licensing_endpoint_throughput", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.MessageRedirectEntity", b => - { - b.Property("FromPhysicalAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("from_physical_address"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("ToPhysicalAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("to_physical_address"); - - b.HasKey("FromPhysicalAddress") - .HasName("pk_message_redirects"); - - b.ToTable("message_redirects", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Classifier") - .HasColumnType("text") - .HasColumnName("classifier"); - - b.Property("Context") - .HasColumnType("text") - .HasColumnName("context"); - - b.Property("InitialBatchSize") - .HasColumnType("integer") - .HasColumnName("initial_batch_size"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("initiated_by_id"); - - b.Property("InitiatedByName") - .HasColumnType("text") - .HasColumnName("initiated_by_name"); - - b.Property("Last") - .HasColumnType("timestamp with time zone") - .HasColumnName("last"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("operation_id"); - - b.Property("Originator") - .HasColumnType("text") - .HasColumnName("originator"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("request_id"); - - b.Property("RetrySessionId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_session_id"); - - b.Property("RetryType") - .HasColumnType("integer") - .HasColumnName("retry_type"); - - b.Property("StagingId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("staging_id"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_time"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.HasKey("Id") - .HasName("pk_retry_batches"); - - b.HasIndex("Status", "RetrySessionId") - .HasDatabaseName("ix_retry_batches_status_retry_session_id"); - - b.ToTable("retry_batches", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchNowForwardingEntity", b => - { - b.Property("Id") - .HasColumnType("integer") - .HasColumnName("id"); - - b.Property("RetryBatchId") - .HasColumnType("uuid") - .HasColumnName("retry_batch_id"); - - b.HasKey("Id") - .HasName("pk_retry_batch_now_forwarding"); - - b.ToTable("retry_batch_now_forwarding", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SettingEntity", b => - { - b.Property("Key") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("key"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text") - .HasColumnName("value"); - - b.HasKey("Key") - .HasName("pk_settings"); - - b.ToTable("settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("message_type"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("transport_address"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("endpoint"); - - b.HasKey("MessageType", "TransportAddress") - .HasName("pk_subscriptions"); - - b.ToTable("subscriptions", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.UnacknowledgedRetryOperationEntity", b => - { - b.Property("RequestId") - .HasMaxLength(400) - .HasColumnType("character varying(400)") - .HasColumnName("request_id"); - - b.Property("RetryType") - .HasColumnType("integer") - .HasColumnName("retry_type"); - - b.Property("Classifier") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("classifier"); - - b.Property("CompletionTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("completion_time"); - - b.Property("Failed") - .HasColumnType("boolean") - .HasColumnName("failed"); - - b.Property("Last") - .HasColumnType("timestamp with time zone") - .HasColumnName("last"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("integer") - .HasColumnName("number_of_messages_processed"); - - b.Property("Originator") - .HasColumnType("text") - .HasColumnName("originator"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_time"); - - b.HasKey("RequestId", "RetryType") - .HasName("pk_unacknowledged_retry_operations"); - - b.ToTable("unacknowledged_retry_operations", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.LicensingEndpointThroughputEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.LicensingEndpointEntity", null) - .WithMany() - .HasForeignKey("NormalizedName", "ThroughputSource") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_licensing_endpoint_throughput_licensing_endpoints_normalize"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260807053832_AddLicensingThroughput.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260807053832_AddLicensingThroughput.cs deleted file mode 100644 index 8a5004759f..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260807053832_AddLicensingThroughput.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class AddLicensingThroughput : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "licensing_endpoints", - columns: table => new - { - normalized_name = table.Column(type: "character varying(300)", maxLength: 300, nullable: false), - throughput_source = table.Column(type: "integer", nullable: false), - name = table.Column(type: "character varying(300)", maxLength: 300, nullable: false), - sanitized_name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), - normalized_sanitized_name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), - user_indicator = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), - scope = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), - endpoint_indicators = table.Column>(type: "text[]", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_licensing_endpoints", x => new { x.normalized_name, x.throughput_source }); - }); - - migrationBuilder.CreateTable( - name: "licensing_endpoint_throughput", - columns: table => new - { - normalized_name = table.Column(type: "character varying(300)", maxLength: 300, nullable: false), - throughput_source = table.Column(type: "integer", nullable: false), - date_utc = table.Column(type: "date", nullable: false), - message_count = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_licensing_endpoint_throughput", x => new { x.normalized_name, x.throughput_source, x.date_utc }); - table.ForeignKey( - name: "fk_licensing_endpoint_throughput_licensing_endpoints_normalize", - columns: x => new { x.normalized_name, x.throughput_source }, - principalTable: "licensing_endpoints", - principalColumns: new[] { "normalized_name", "throughput_source" }, - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "ix_licensing_endpoint_throughput_date_utc", - table: "licensing_endpoint_throughput", - column: "date_utc"); - - migrationBuilder.CreateIndex( - name: "ix_licensing_endpoints_normalized_sanitized_name", - table: "licensing_endpoints", - column: "normalized_sanitized_name"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "licensing_endpoint_throughput"); - - migrationBuilder.DropTable( - name: "licensing_endpoints"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260811010034_AddFailedMessageEdits.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260811010034_AddFailedMessageEdits.Designer.cs deleted file mode 100644 index 7238d8ebfa..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260811010034_AddFailedMessageEdits.Designer.cs +++ /dev/null @@ -1,887 +0,0 @@ -// -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using ServiceControl.Persistence.EFCore.PostgreSql; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260811010034_AddFailedMessageEdits")] - partial class AddFailedMessageEdits - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.ArchiveOperationEntity", b => - { - b.Property("RequestId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("request_id"); - - b.Property("ArchiveType") - .HasColumnType("integer") - .HasColumnName("archive_type"); - - b.Property("OperationType") - .HasColumnType("integer") - .HasColumnName("operation_type"); - - b.Property("CurrentBatch") - .HasColumnType("integer") - .HasColumnName("current_batch"); - - b.Property("GroupName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("group_name"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("initiated_by_id"); - - b.Property("InitiatedByName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("initiated_by_name"); - - b.Property("NumberOfBatches") - .HasColumnType("integer") - .HasColumnName("number_of_batches"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("integer") - .HasColumnName("number_of_messages_processed"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("operation_id"); - - b.Property("Started") - .HasColumnType("timestamp with time zone") - .HasColumnName("started"); - - b.Property("TotalNumberOfMessages") - .HasColumnType("integer") - .HasColumnName("total_number_of_messages"); - - b.HasKey("RequestId", "ArchiveType", "OperationType") - .HasName("pk_archive_operations"); - - b.HasIndex("Started") - .HasDatabaseName("ix_archive_operations_started"); - - b.ToTable("archive_operations", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.CustomCheckEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Category") - .IsRequired() - .HasColumnType("text") - .HasColumnName("category"); - - b.Property("CustomCheckId") - .IsRequired() - .HasColumnType("text") - .HasColumnName("custom_check_id"); - - b.Property("FailureReason") - .HasColumnType("text") - .HasColumnName("failure_reason"); - - b.Property("OriginatingEndpointHost") - .IsRequired() - .HasColumnType("text") - .HasColumnName("originating_endpoint_host"); - - b.Property("OriginatingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("originating_endpoint_host_id"); - - b.Property("OriginatingEndpointName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("originating_endpoint_name"); - - b.Property("ReportedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("reported_at"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.HasKey("Id") - .HasName("pk_custom_checks"); - - b.HasIndex("ReportedAt") - .HasDatabaseName("ix_custom_checks_reported_at"); - - b.HasIndex("Status", "ReportedAt") - .HasDatabaseName("ix_custom_checks_status_reported_at"); - - b.ToTable("custom_checks", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.Property("TrackInstances") - .HasColumnType("boolean") - .HasColumnName("track_instances"); - - b.HasKey("Name") - .HasName("pk_endpoint_settings"); - - b.ToTable("endpoint_settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("category"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("event_type"); - - b.Property("RaisedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("raised_at"); - - b.PrimitiveCollection>("RelatedTo") - .IsRequired() - .HasColumnType("text[]") - .HasColumnName("related_to"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("pk_event_log_items"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending() - .HasDatabaseName("ix_event_log_items_raised_at_id"); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("Body") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("body"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("text") - .HasColumnName("exception_info"); - - b.Property("FailedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("failed_at"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_error_imports"); - - b.HasIndex("FailedAt") - .HasDatabaseName("ix_failed_error_imports_failed_at"); - - b.ToTable("failed_error_imports", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEditEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("EditId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("edit_id"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_edits"); - - b.HasIndex("EditId") - .HasDatabaseName("ix_failed_message_edits_edit_id"); - - b.ToTable("failed_message_edits", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("body_content_type"); - - b.Property("BodySize") - .HasColumnType("integer") - .HasColumnName("body_size"); - - b.Property("BodyStoredExternally") - .HasColumnType("boolean") - .HasColumnName("body_stored_externally"); - - b.Property("BodyText") - .HasColumnType("text") - .HasColumnName("body_text"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("conversation_id"); - - b.Property("ExceptionMessage") - .HasColumnType("text") - .HasColumnName("exception_message"); - - b.Property("ExceptionType") - .HasColumnType("text") - .HasColumnName("exception_type"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("failing_endpoint_address"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_time_of_failure"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("text") - .HasColumnName("headers_json"); - - b.Property("IsSystemMessage") - .HasColumnType("boolean") - .HasColumnName("is_system_message"); - - b.Property("LastAttemptedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_attempted_at"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("LastTimeOfFailure") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_time_of_failure"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("message_id"); - - b.Property("MessageType") - .HasColumnType("text") - .HasColumnName("message_type"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("integer") - .HasColumnName("number_of_processing_attempts"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_host"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("receiving_endpoint_host_id"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("receiving_endpoint_name"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_host"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uuid") - .HasColumnName("sending_endpoint_host_id"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sending_endpoint_name"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("StatusChangedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("status_changed_at"); - - b.Property("TimeSent") - .HasColumnType("timestamp with time zone") - .HasColumnName("time_sent"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_messages"); - - b.HasIndex("ConversationId") - .HasDatabaseName("ix_failed_messages_conversation_id"); - - b.HasIndex("FailingEndpointAddress") - .HasDatabaseName("ix_failed_messages_failing_endpoint_address"); - - b.HasIndex("ReceivingEndpointName") - .HasDatabaseName("ix_failed_messages_receiving_endpoint_name"); - - b.HasIndex("StatusChangedAt") - .HasDatabaseName("ix_failed_messages_status_changed_at") - .HasFilter("status IN (2, 4)"); - - b.HasIndex("TimeSent") - .HasDatabaseName("ix_failed_messages_time_sent"); - - b.HasIndex("Status", "LastModified") - .HasDatabaseName("ix_failed_messages_status_last_modified"); - - b.ToTable("failed_messages", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uuid") - .HasColumnName("failed_message_unique_id"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("type"); - - b.HasKey("FailedMessageUniqueId", "GroupId") - .HasName("pk_failed_message_groups"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_failed_message_groups_group_id"); - - b.HasIndex("Type", "GroupId") - .HasDatabaseName("ix_failed_message_groups_type_group_id"); - - b.ToTable("failed_message_groups", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uuid") - .HasColumnName("unique_message_id"); - - b.Property("RetryBatchId") - .HasColumnType("uuid") - .HasColumnName("retry_batch_id"); - - b.Property("StageAttempts") - .HasColumnType("integer") - .HasColumnName("stage_attempts"); - - b.HasKey("UniqueMessageId") - .HasName("pk_failed_message_retries"); - - b.HasIndex("RetryBatchId") - .HasDatabaseName("ix_failed_message_retries_retry_batch_id"); - - b.ToTable("failed_message_retries", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.GroupCommentEntity", b => - { - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("group_id"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("text") - .HasColumnName("comment"); - - b.HasKey("GroupId") - .HasName("pk_group_comments"); - - b.ToTable("group_comments", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.HistoricRetryOperationEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CompletionTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("completion_time"); - - b.Property("Failed") - .HasColumnType("boolean") - .HasColumnName("failed"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("integer") - .HasColumnName("number_of_messages_processed"); - - b.Property("Originator") - .HasColumnType("text") - .HasColumnName("originator"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(400) - .HasColumnType("character varying(400)") - .HasColumnName("request_id"); - - b.Property("RetryType") - .HasColumnType("integer") - .HasColumnName("retry_type"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_time"); - - b.HasKey("Id") - .HasName("pk_historic_retry_operations"); - - b.HasIndex("CompletionTime", "Id") - .IsDescending() - .HasDatabaseName("ix_historic_retry_operations_completion_time_id"); - - b.ToTable("historic_retry_operations", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("host"); - - b.Property("HostId") - .HasColumnType("uuid") - .HasColumnName("host_id"); - - b.Property("Monitored") - .HasColumnType("boolean") - .HasColumnName("monitored"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_known_endpoints"); - - b.ToTable("known_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.LicensingEndpointEntity", b => - { - b.Property("NormalizedName") - .HasMaxLength(300) - .HasColumnType("character varying(300)") - .HasColumnName("normalized_name"); - - b.Property("ThroughputSource") - .HasColumnType("integer") - .HasColumnName("throughput_source"); - - b.PrimitiveCollection>("EndpointIndicators") - .IsRequired() - .HasColumnType("text[]") - .HasColumnName("endpoint_indicators"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("character varying(300)") - .HasColumnName("name"); - - b.Property("NormalizedSanitizedName") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("normalized_sanitized_name"); - - b.Property("SanitizedName") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("sanitized_name"); - - b.Property("Scope") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("scope"); - - b.Property("UserIndicator") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("user_indicator"); - - b.HasKey("NormalizedName", "ThroughputSource") - .HasName("pk_licensing_endpoints"); - - b.HasIndex("NormalizedSanitizedName") - .HasDatabaseName("ix_licensing_endpoints_normalized_sanitized_name"); - - b.ToTable("licensing_endpoints", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.LicensingEndpointThroughputEntity", b => - { - b.Property("NormalizedName") - .HasMaxLength(300) - .HasColumnType("character varying(300)") - .HasColumnName("normalized_name"); - - b.Property("ThroughputSource") - .HasColumnType("integer") - .HasColumnName("throughput_source"); - - b.Property("DateUtc") - .HasColumnType("date") - .HasColumnName("date_utc"); - - b.Property("MessageCount") - .HasColumnType("bigint") - .HasColumnName("message_count"); - - b.HasKey("NormalizedName", "ThroughputSource", "DateUtc") - .HasName("pk_licensing_endpoint_throughput"); - - b.HasIndex("DateUtc") - .HasDatabaseName("ix_licensing_endpoint_throughput_date_utc"); - - b.ToTable("licensing_endpoint_throughput", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.MessageRedirectEntity", b => - { - b.Property("FromPhysicalAddress") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("from_physical_address"); - - b.Property("LastModified") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_modified"); - - b.Property("ToPhysicalAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("to_physical_address"); - - b.HasKey("FromPhysicalAddress") - .HasName("pk_message_redirects"); - - b.ToTable("message_redirects", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchEntity", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Classifier") - .HasColumnType("text") - .HasColumnName("classifier"); - - b.Property("Context") - .HasColumnType("text") - .HasColumnName("context"); - - b.Property("InitialBatchSize") - .HasColumnType("integer") - .HasColumnName("initial_batch_size"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("initiated_by_id"); - - b.Property("InitiatedByName") - .HasColumnType("text") - .HasColumnName("initiated_by_name"); - - b.Property("Last") - .HasColumnType("timestamp with time zone") - .HasColumnName("last"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("operation_id"); - - b.Property("Originator") - .HasColumnType("text") - .HasColumnName("originator"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("request_id"); - - b.Property("RetrySessionId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("retry_session_id"); - - b.Property("RetryType") - .HasColumnType("integer") - .HasColumnName("retry_type"); - - b.Property("StagingId") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("staging_id"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_time"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.HasKey("Id") - .HasName("pk_retry_batches"); - - b.HasIndex("Status", "RetrySessionId") - .HasDatabaseName("ix_retry_batches_status_retry_session_id"); - - b.ToTable("retry_batches", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchNowForwardingEntity", b => - { - b.Property("Id") - .HasColumnType("integer") - .HasColumnName("id"); - - b.Property("RetryBatchId") - .HasColumnType("uuid") - .HasColumnName("retry_batch_id"); - - b.HasKey("Id") - .HasName("pk_retry_batch_now_forwarding"); - - b.ToTable("retry_batch_now_forwarding", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SettingEntity", b => - { - b.Property("Key") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("key"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text") - .HasColumnName("value"); - - b.HasKey("Key") - .HasName("pk_settings"); - - b.ToTable("settings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("message_type"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("transport_address"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("endpoint"); - - b.HasKey("MessageType", "TransportAddress") - .HasName("pk_subscriptions"); - - b.ToTable("subscriptions", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.UnacknowledgedRetryOperationEntity", b => - { - b.Property("RequestId") - .HasMaxLength(400) - .HasColumnType("character varying(400)") - .HasColumnName("request_id"); - - b.Property("RetryType") - .HasColumnType("integer") - .HasColumnName("retry_type"); - - b.Property("Classifier") - .HasMaxLength(450) - .HasColumnType("character varying(450)") - .HasColumnName("classifier"); - - b.Property("CompletionTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("completion_time"); - - b.Property("Failed") - .HasColumnType("boolean") - .HasColumnName("failed"); - - b.Property("Last") - .HasColumnType("timestamp with time zone") - .HasColumnName("last"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("integer") - .HasColumnName("number_of_messages_processed"); - - b.Property("Originator") - .HasColumnType("text") - .HasColumnName("originator"); - - b.Property("StartTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_time"); - - b.HasKey("RequestId", "RetryType") - .HasName("pk_unacknowledged_retry_operations"); - - b.ToTable("unacknowledged_retry_operations", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_failed_message_groups_failed_messages_failed_message_unique"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.LicensingEndpointThroughputEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.LicensingEndpointEntity", null) - .WithMany() - .HasForeignKey("NormalizedName", "ThroughputSource") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_licensing_endpoint_throughput_licensing_endpoints_normalize"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260811010034_AddFailedMessageEdits.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260811010034_AddFailedMessageEdits.cs deleted file mode 100644 index ca172a8acd..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260811010034_AddFailedMessageEdits.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class AddFailedMessageEdits : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "failed_message_edits", - columns: table => new - { - unique_message_id = table.Column(type: "uuid", nullable: false), - edit_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_failed_message_edits", x => x.unique_message_id); - }); - - migrationBuilder.CreateIndex( - name: "ix_failed_message_edits_edit_id", - table: "failed_message_edits", - column: "edit_id"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "failed_message_edits"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260811033225_AddExternalIntegrationDispatchRequests.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260811033225_AddExternalIntegrationDispatchRequests.cs deleted file mode 100644 index 21e999c399..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260811033225_AddExternalIntegrationDispatchRequests.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class AddExternalIntegrationDispatchRequests : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "ExternalIntegrationDispatchRequests", - columns: table => new - { - id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - dispatch_context_type_name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), - dispatch_context_json = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_external_integration_dispatch_requests", x => x.id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ExternalIntegrationDispatchRequests"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260812000001_MakeFailingEndpointAddressNonNull.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260812000001_MakeFailingEndpointAddressNonNull.cs deleted file mode 100644 index df965e2896..0000000000 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260812000001_MakeFailingEndpointAddressNonNull.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations -{ - /// - public partial class MakeFailingEndpointAddressNonNull : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - // In practice no rows have a null failing_endpoint_address — ingestion throws if the - // FailedQ header is missing — but defaultValue ensures any strays are cleaned up - // before the column is made NOT NULL. - migrationBuilder.AlterColumn( - name: "failing_endpoint_address", - table: "failed_messages", - type: "character varying(450)", - maxLength: 450, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(450)", - oldMaxLength: 450, - oldNullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "failing_endpoint_address", - table: "failed_messages", - type: "character varying(450)", - maxLength: 450, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(450)", - oldMaxLength: 450); - } - } -} \ No newline at end of file diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260811033225_AddExternalIntegrationDispatchRequests.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221615_Initial.Designer.cs similarity index 97% rename from src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260811033225_AddExternalIntegrationDispatchRequests.Designer.cs rename to src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221615_Initial.Designer.cs index 03b08fcd64..7ce35fa9fd 100644 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260811033225_AddExternalIntegrationDispatchRequests.Designer.cs +++ b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221615_Initial.Designer.cs @@ -13,15 +13,15 @@ namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations { [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260811033225_AddExternalIntegrationDispatchRequests")] - partial class AddExternalIntegrationDispatchRequests + [Migration("20260901221615_Initial")] + partial class Initial { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") + .HasAnnotation("ProductVersion", "10.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -280,6 +280,27 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("failed_error_imports", (string)null); }); + modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEditEntity", b => + { + b.Property("UniqueMessageId") + .HasColumnType("uuid") + .HasColumnName("unique_message_id"); + + b.Property("EditId") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)") + .HasColumnName("edit_id"); + + b.HasKey("UniqueMessageId") + .HasName("pk_failed_message_edits"); + + b.HasIndex("EditId") + .HasDatabaseName("ix_failed_message_edits_edit_id"); + + b.ToTable("failed_message_edits", (string)null); + }); + modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => { b.Property("UniqueMessageId") @@ -317,6 +338,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnName("exception_type"); b.Property("FailingEndpointAddress") + .IsRequired() .HasMaxLength(450) .HasColumnType("character varying(450)") .HasColumnName("failing_endpoint_address"); diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221615_Initial.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221615_Initial.cs new file mode 100644 index 0000000000..bcd596230d --- /dev/null +++ b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221615_Initial.cs @@ -0,0 +1,544 @@ +using System; +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations +{ + /// + public partial class Initial : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "archive_operations", + columns: table => new + { + request_id = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + archive_type = table.Column(type: "integer", nullable: false), + operation_type = table.Column(type: "integer", nullable: false), + group_name = table.Column(type: "text", nullable: false), + total_number_of_messages = table.Column(type: "integer", nullable: false), + number_of_messages_processed = table.Column(type: "integer", nullable: false), + number_of_batches = table.Column(type: "integer", nullable: false), + current_batch = table.Column(type: "integer", nullable: false), + started = table.Column(type: "timestamp with time zone", nullable: false), + initiated_by_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + initiated_by_name = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + operation_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_archive_operations", x => new { x.request_id, x.archive_type, x.operation_type }); + }); + + migrationBuilder.CreateTable( + name: "custom_checks", + columns: table => new + { + id = table.Column(type: "uuid", nullable: false), + custom_check_id = table.Column(type: "text", nullable: false), + category = table.Column(type: "text", nullable: false), + status = table.Column(type: "integer", nullable: false), + reported_at = table.Column(type: "timestamp with time zone", nullable: false), + failure_reason = table.Column(type: "text", nullable: true), + originating_endpoint_name = table.Column(type: "text", nullable: false), + originating_endpoint_host_id = table.Column(type: "uuid", nullable: false), + originating_endpoint_host = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_custom_checks", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "endpoint_settings", + columns: table => new + { + name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + track_instances = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_endpoint_settings", x => x.name); + }); + + migrationBuilder.CreateTable( + name: "EventLogItems", + columns: table => new + { + id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + description = table.Column(type: "text", nullable: false), + severity = table.Column(type: "integer", nullable: false), + raised_at = table.Column(type: "timestamp with time zone", nullable: false), + related_to = table.Column>(type: "text[]", nullable: false), + category = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + event_type = table.Column(type: "character varying(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_event_log_items", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "ExternalIntegrationDispatchRequests", + columns: table => new + { + id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + dispatch_context_type_name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + dispatch_context_json = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_external_integration_dispatch_requests", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "failed_error_imports", + columns: table => new + { + unique_message_id = table.Column(type: "uuid", nullable: false), + failed_at = table.Column(type: "timestamp with time zone", nullable: false), + message_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + headers_json = table.Column(type: "text", nullable: false), + body = table.Column(type: "bytea", nullable: false), + body_stored_externally = table.Column(type: "boolean", nullable: false), + exception_info = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_failed_error_imports", x => x.unique_message_id); + }); + + migrationBuilder.CreateTable( + name: "failed_message_edits", + columns: table => new + { + unique_message_id = table.Column(type: "uuid", nullable: false), + edit_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_failed_message_edits", x => x.unique_message_id); + }); + + migrationBuilder.CreateTable( + name: "failed_message_retries", + columns: table => new + { + unique_message_id = table.Column(type: "uuid", nullable: false), + retry_batch_id = table.Column(type: "uuid", nullable: false), + stage_attempts = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_failed_message_retries", x => x.unique_message_id); + }); + + migrationBuilder.CreateTable( + name: "failed_messages", + columns: table => new + { + unique_message_id = table.Column(type: "uuid", nullable: false), + status = table.Column(type: "integer", nullable: false), + status_changed_at = table.Column(type: "timestamp with time zone", nullable: false), + last_modified = table.Column(type: "timestamp with time zone", nullable: false), + number_of_processing_attempts = table.Column(type: "integer", nullable: false), + first_time_of_failure = table.Column(type: "timestamp with time zone", nullable: false), + last_time_of_failure = table.Column(type: "timestamp with time zone", nullable: false), + last_attempted_at = table.Column(type: "timestamp with time zone", nullable: false), + message_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + message_type = table.Column(type: "text", nullable: true), + time_sent = table.Column(type: "timestamp with time zone", nullable: true), + conversation_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + sending_endpoint_name = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + sending_endpoint_host_id = table.Column(type: "uuid", nullable: true), + sending_endpoint_host = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + receiving_endpoint_name = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + receiving_endpoint_host_id = table.Column(type: "uuid", nullable: true), + receiving_endpoint_host = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + exception_type = table.Column(type: "text", nullable: true), + exception_message = table.Column(type: "text", nullable: true), + is_system_message = table.Column(type: "boolean", nullable: false), + headers_json = table.Column(type: "text", nullable: false), + body_text = table.Column(type: "text", nullable: true), + body_stored_externally = table.Column(type: "boolean", nullable: false), + body_size = table.Column(type: "integer", nullable: false), + body_content_type = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + failing_endpoint_address = table.Column(type: "character varying(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_failed_messages", x => x.unique_message_id); + }); + + migrationBuilder.CreateTable( + name: "group_comments", + columns: table => new + { + group_id = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + comment = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_group_comments", x => x.group_id); + }); + + migrationBuilder.CreateTable( + name: "historic_retry_operations", + columns: table => new + { + id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + request_id = table.Column(type: "character varying(400)", maxLength: 400, nullable: false), + retry_type = table.Column(type: "integer", nullable: false), + start_time = table.Column(type: "timestamp with time zone", nullable: false), + completion_time = table.Column(type: "timestamp with time zone", nullable: false), + originator = table.Column(type: "text", nullable: true), + failed = table.Column(type: "boolean", nullable: false), + number_of_messages_processed = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_historic_retry_operations", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "known_endpoints", + columns: table => new + { + id = table.Column(type: "uuid", nullable: false), + name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + host_id = table.Column(type: "uuid", nullable: false), + host = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + monitored = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_known_endpoints", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "licensing_endpoints", + columns: table => new + { + normalized_name = table.Column(type: "character varying(300)", maxLength: 300, nullable: false), + throughput_source = table.Column(type: "integer", nullable: false), + name = table.Column(type: "character varying(300)", maxLength: 300, nullable: false), + sanitized_name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + normalized_sanitized_name = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + user_indicator = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + scope = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + endpoint_indicators = table.Column>(type: "text[]", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_licensing_endpoints", x => new { x.normalized_name, x.throughput_source }); + }); + + migrationBuilder.CreateTable( + name: "message_redirects", + columns: table => new + { + from_physical_address = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + to_physical_address = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + last_modified = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_message_redirects", x => x.from_physical_address); + }); + + migrationBuilder.CreateTable( + name: "retry_batch_now_forwarding", + columns: table => new + { + id = table.Column(type: "integer", nullable: false), + retry_batch_id = table.Column(type: "uuid", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_retry_batch_now_forwarding", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "retry_batches", + columns: table => new + { + id = table.Column(type: "uuid", nullable: false), + status = table.Column(type: "integer", nullable: false), + retry_session_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + request_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + retry_type = table.Column(type: "integer", nullable: false), + initial_batch_size = table.Column(type: "integer", nullable: false), + start_time = table.Column(type: "timestamp with time zone", nullable: false), + last = table.Column(type: "timestamp with time zone", nullable: true), + staging_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + context = table.Column(type: "text", nullable: true), + originator = table.Column(type: "text", nullable: true), + classifier = table.Column(type: "text", nullable: true), + initiated_by_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + initiated_by_name = table.Column(type: "text", nullable: true), + operation_id = table.Column(type: "character varying(450)", maxLength: 450, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_retry_batches", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "settings", + columns: table => new + { + key = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), + value = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_settings", x => x.key); + }); + + migrationBuilder.CreateTable( + name: "subscriptions", + columns: table => new + { + message_type = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), + transport_address = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), + endpoint = table.Column(type: "character varying(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_subscriptions", x => new { x.message_type, x.transport_address }); + }); + + migrationBuilder.CreateTable( + name: "unacknowledged_retry_operations", + columns: table => new + { + request_id = table.Column(type: "character varying(400)", maxLength: 400, nullable: false), + retry_type = table.Column(type: "integer", nullable: false), + start_time = table.Column(type: "timestamp with time zone", nullable: false), + completion_time = table.Column(type: "timestamp with time zone", nullable: false), + last = table.Column(type: "timestamp with time zone", nullable: false), + originator = table.Column(type: "text", nullable: true), + classifier = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), + failed = table.Column(type: "boolean", nullable: false), + number_of_messages_processed = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_unacknowledged_retry_operations", x => new { x.request_id, x.retry_type }); + }); + + migrationBuilder.CreateTable( + name: "failed_message_groups", + columns: table => new + { + failed_message_unique_id = table.Column(type: "uuid", nullable: false), + group_id = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + title = table.Column(type: "text", nullable: false), + type = table.Column(type: "character varying(255)", maxLength: 255, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_failed_message_groups", x => new { x.failed_message_unique_id, x.group_id }); + table.ForeignKey( + name: "fk_failed_message_groups_failed_messages_failed_message_unique", + column: x => x.failed_message_unique_id, + principalTable: "failed_messages", + principalColumn: "unique_message_id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "licensing_endpoint_throughput", + columns: table => new + { + normalized_name = table.Column(type: "character varying(300)", maxLength: 300, nullable: false), + throughput_source = table.Column(type: "integer", nullable: false), + date_utc = table.Column(type: "date", nullable: false), + message_count = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_licensing_endpoint_throughput", x => new { x.normalized_name, x.throughput_source, x.date_utc }); + table.ForeignKey( + name: "fk_licensing_endpoint_throughput_licensing_endpoints_normalize", + columns: x => new { x.normalized_name, x.throughput_source }, + principalTable: "licensing_endpoints", + principalColumns: new[] { "normalized_name", "throughput_source" }, + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "ix_archive_operations_started", + table: "archive_operations", + column: "started"); + + migrationBuilder.CreateIndex( + name: "ix_custom_checks_reported_at", + table: "custom_checks", + column: "reported_at"); + + migrationBuilder.CreateIndex( + name: "ix_custom_checks_status_reported_at", + table: "custom_checks", + columns: new[] { "status", "reported_at" }); + + migrationBuilder.CreateIndex( + name: "ix_event_log_items_raised_at_id", + table: "EventLogItems", + columns: new[] { "raised_at", "id" }, + descending: new bool[0]); + + migrationBuilder.CreateIndex( + name: "ix_failed_error_imports_failed_at", + table: "failed_error_imports", + column: "failed_at"); + + migrationBuilder.CreateIndex( + name: "ix_failed_message_edits_edit_id", + table: "failed_message_edits", + column: "edit_id"); + + migrationBuilder.CreateIndex( + name: "ix_failed_message_groups_group_id", + table: "failed_message_groups", + column: "group_id"); + + migrationBuilder.CreateIndex( + name: "ix_failed_message_groups_type_group_id", + table: "failed_message_groups", + columns: new[] { "type", "group_id" }); + + migrationBuilder.CreateIndex( + name: "ix_failed_message_retries_retry_batch_id", + table: "failed_message_retries", + column: "retry_batch_id"); + + migrationBuilder.CreateIndex( + name: "ix_failed_messages_conversation_id", + table: "failed_messages", + column: "conversation_id"); + + migrationBuilder.CreateIndex( + name: "ix_failed_messages_failing_endpoint_address", + table: "failed_messages", + column: "failing_endpoint_address"); + + migrationBuilder.CreateIndex( + name: "ix_failed_messages_receiving_endpoint_name", + table: "failed_messages", + column: "receiving_endpoint_name"); + + migrationBuilder.CreateIndex( + name: "ix_failed_messages_status_changed_at", + table: "failed_messages", + column: "status_changed_at", + filter: "status IN (2, 4)"); + + migrationBuilder.CreateIndex( + name: "ix_failed_messages_status_last_modified", + table: "failed_messages", + columns: new[] { "status", "last_modified" }); + + migrationBuilder.CreateIndex( + name: "ix_failed_messages_time_sent", + table: "failed_messages", + column: "time_sent"); + + migrationBuilder.CreateIndex( + name: "ix_historic_retry_operations_completion_time_id", + table: "historic_retry_operations", + columns: new[] { "completion_time", "id" }, + descending: new bool[0]); + + migrationBuilder.CreateIndex( + name: "ix_licensing_endpoint_throughput_date_utc", + table: "licensing_endpoint_throughput", + column: "date_utc"); + + migrationBuilder.CreateIndex( + name: "ix_licensing_endpoints_normalized_sanitized_name", + table: "licensing_endpoints", + column: "normalized_sanitized_name"); + + migrationBuilder.CreateIndex( + name: "ix_retry_batches_status_retry_session_id", + table: "retry_batches", + columns: new[] { "status", "retry_session_id" }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "archive_operations"); + + migrationBuilder.DropTable( + name: "custom_checks"); + + migrationBuilder.DropTable( + name: "endpoint_settings"); + + migrationBuilder.DropTable( + name: "EventLogItems"); + + migrationBuilder.DropTable( + name: "ExternalIntegrationDispatchRequests"); + + migrationBuilder.DropTable( + name: "failed_error_imports"); + + migrationBuilder.DropTable( + name: "failed_message_edits"); + + migrationBuilder.DropTable( + name: "failed_message_groups"); + + migrationBuilder.DropTable( + name: "failed_message_retries"); + + migrationBuilder.DropTable( + name: "group_comments"); + + migrationBuilder.DropTable( + name: "historic_retry_operations"); + + migrationBuilder.DropTable( + name: "known_endpoints"); + + migrationBuilder.DropTable( + name: "licensing_endpoint_throughput"); + + migrationBuilder.DropTable( + name: "message_redirects"); + + migrationBuilder.DropTable( + name: "retry_batch_now_forwarding"); + + migrationBuilder.DropTable( + name: "retry_batches"); + + migrationBuilder.DropTable( + name: "settings"); + + migrationBuilder.DropTable( + name: "subscriptions"); + + migrationBuilder.DropTable( + name: "unacknowledged_retry_operations"); + + migrationBuilder.DropTable( + name: "failed_messages"); + + migrationBuilder.DropTable( + name: "licensing_endpoints"); + } + } +} diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260812000001_MakeFailingEndpointAddressNonNull.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221623_AddFullTextSearch.Designer.cs similarity index 96% rename from src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260812000001_MakeFailingEndpointAddressNonNull.Designer.cs rename to src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221623_AddFullTextSearch.Designer.cs index 3fa1b5a975..e6cf93ab97 100644 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260812000001_MakeFailingEndpointAddressNonNull.Designer.cs +++ b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221623_AddFullTextSearch.Designer.cs @@ -13,15 +13,15 @@ namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations { [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260812000001_MakeFailingEndpointAddressNonNull")] - partial class MakeFailingEndpointAddressNonNull + [Migration("20260901221623_AddFullTextSearch")] + partial class AddFullTextSearch { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") + .HasAnnotation("ProductVersion", "10.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -210,6 +210,32 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("EventLogItems", (string)null); }); + modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.ExternalIntegrationDispatchRequestEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DispatchContextJson") + .IsRequired() + .HasColumnType("text") + .HasColumnName("dispatch_context_json"); + + b.Property("DispatchContextTypeName") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("character varying(450)") + .HasColumnName("dispatch_context_type_name"); + + b.HasKey("Id") + .HasName("pk_external_integration_dispatch_requests"); + + b.ToTable("ExternalIntegrationDispatchRequests", (string)null); + }); + modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => { b.Property("UniqueMessageId") diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260722061316_AddFullTextSearch.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221623_AddFullTextSearch.cs similarity index 100% rename from src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260722061316_AddFullTextSearch.cs rename to src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221623_AddFullTextSearch.cs diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/PostgreSqlServiceControlDbContextModelSnapshot.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/PostgreSqlServiceControlDbContextModelSnapshot.cs index 01cc4c648e..89d3c4c112 100644 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/PostgreSqlServiceControlDbContextModelSnapshot.cs +++ b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/PostgreSqlServiceControlDbContextModelSnapshot.cs @@ -18,7 +18,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") + .HasAnnotation("ProductVersion", "10.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260722061320_Initial.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260722061320_Initial.Designer.cs deleted file mode 100644 index 27b9d2b309..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260722061320_Initial.Designer.cs +++ /dev/null @@ -1,212 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260722061320_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("QueueAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("QueueAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260722061320_Initial.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260722061320_Initial.cs deleted file mode 100644 index f15a501188..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260722061320_Initial.cs +++ /dev/null @@ -1,151 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class Initial : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "FailedMessageRetries", - columns: table => new - { - UniqueMessageId = table.Column(type: "uniqueidentifier", nullable: false), - RetryId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_FailedMessageRetries", x => x.UniqueMessageId); - }); - - migrationBuilder.CreateTable( - name: "FailedMessages", - columns: table => new - { - UniqueMessageId = table.Column(type: "uniqueidentifier", nullable: false), - Status = table.Column(type: "int", nullable: false), - StatusChangedAt = table.Column(type: "datetime2", nullable: false), - LastModified = table.Column(type: "datetime2", nullable: false), - NumberOfProcessingAttempts = table.Column(type: "int", nullable: false), - FirstTimeOfFailure = table.Column(type: "datetime2", nullable: false), - LastTimeOfFailure = table.Column(type: "datetime2", nullable: false), - LastAttemptedAt = table.Column(type: "datetime2", nullable: false), - MessageId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - MessageType = table.Column(type: "nvarchar(max)", nullable: true), - TimeSent = table.Column(type: "datetime2", nullable: true), - ConversationId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - QueueAddress = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - SendingEndpointName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - SendingEndpointHostId = table.Column(type: "uniqueidentifier", nullable: true), - SendingEndpointHost = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - ReceivingEndpointName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - ReceivingEndpointHostId = table.Column(type: "uniqueidentifier", nullable: true), - ReceivingEndpointHost = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - ExceptionType = table.Column(type: "nvarchar(max)", nullable: true), - ExceptionMessage = table.Column(type: "nvarchar(max)", nullable: true), - IsSystemMessage = table.Column(type: "bit", nullable: false), - HeadersJson = table.Column(type: "nvarchar(max)", nullable: false), - BodyText = table.Column(type: "nvarchar(max)", nullable: true), - BodyStoredExternally = table.Column(type: "bit", nullable: false), - BodySize = table.Column(type: "int", nullable: false), - BodyContentType = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_FailedMessages", x => x.UniqueMessageId); - }); - - migrationBuilder.CreateTable( - name: "KnownEndpoints", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(max)", nullable: false), - HostId = table.Column(type: "uniqueidentifier", nullable: false), - Host = table.Column(type: "nvarchar(max)", nullable: false), - Monitored = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_KnownEndpoints", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "FailedMessageGroups", - columns: table => new - { - FailedMessageUniqueId = table.Column(type: "uniqueidentifier", nullable: false), - GroupId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Title = table.Column(type: "nvarchar(max)", nullable: false), - Type = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_FailedMessageGroups", x => new { x.FailedMessageUniqueId, x.GroupId }); - table.ForeignKey( - name: "FK_FailedMessageGroups_FailedMessages_FailedMessageUniqueId", - column: x => x.FailedMessageUniqueId, - principalTable: "FailedMessages", - principalColumn: "UniqueMessageId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_FailedMessageGroups_GroupId", - table: "FailedMessageGroups", - column: "GroupId"); - - migrationBuilder.CreateIndex( - name: "IX_FailedMessages_ConversationId", - table: "FailedMessages", - column: "ConversationId"); - - migrationBuilder.CreateIndex( - name: "IX_FailedMessages_QueueAddress", - table: "FailedMessages", - column: "QueueAddress"); - - migrationBuilder.CreateIndex( - name: "IX_FailedMessages_ReceivingEndpointName", - table: "FailedMessages", - column: "ReceivingEndpointName"); - - migrationBuilder.CreateIndex( - name: "IX_FailedMessages_Status_LastModified", - table: "FailedMessages", - columns: new[] { "Status", "LastModified" }); - - migrationBuilder.CreateIndex( - name: "IX_FailedMessages_StatusChangedAt", - table: "FailedMessages", - column: "StatusChangedAt", - filter: "[Status] IN (2, 4)"); - - migrationBuilder.CreateIndex( - name: "IX_FailedMessages_TimeSent", - table: "FailedMessages", - column: "TimeSent"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "FailedMessageGroups"); - - migrationBuilder.DropTable( - name: "FailedMessageRetries"); - - migrationBuilder.DropTable( - name: "KnownEndpoints"); - - migrationBuilder.DropTable( - name: "FailedMessages"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260722061323_AddFullTextSearch.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260722061323_AddFullTextSearch.Designer.cs deleted file mode 100644 index 4e36cde31e..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260722061323_AddFullTextSearch.Designer.cs +++ /dev/null @@ -1,212 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260722061323_AddFullTextSearch")] - partial class AddFullTextSearch - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.9") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("QueueAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("QueueAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260723082337_AddKnownEndpointMaxLength.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260723082337_AddKnownEndpointMaxLength.Designer.cs deleted file mode 100644 index 686c392038..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260723082337_AddKnownEndpointMaxLength.Designer.cs +++ /dev/null @@ -1,214 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260723082337_AddKnownEndpointMaxLength")] - partial class AddKnownEndpointMaxLength - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("QueueAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("QueueAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260723082337_AddKnownEndpointMaxLength.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260723082337_AddKnownEndpointMaxLength.cs deleted file mode 100644 index 32233ec132..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260723082337_AddKnownEndpointMaxLength.cs +++ /dev/null @@ -1,54 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class AddKnownEndpointMaxLength : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Name", - table: "KnownEndpoints", - type: "nvarchar(450)", - maxLength: 450, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(max)"); - - migrationBuilder.AlterColumn( - name: "Host", - table: "KnownEndpoints", - type: "nvarchar(450)", - maxLength: 450, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(max)"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Name", - table: "KnownEndpoints", - type: "nvarchar(max)", - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(450)", - oldMaxLength: 450); - - migrationBuilder.AlterColumn( - name: "Host", - table: "KnownEndpoints", - type: "nvarchar(max)", - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(450)", - oldMaxLength: 450); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260724055947_AddConfiguration.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260724055947_AddConfiguration.Designer.cs deleted file mode 100644 index 13ee34cf70..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260724055947_AddConfiguration.Designer.cs +++ /dev/null @@ -1,257 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260724055947_AddConfiguration")] - partial class AddConfiguration - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("TrackInstances") - .HasColumnType("bit"); - - b.HasKey("Name"); - - b.ToTable("EndpointSettings", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FailingEndpointAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("QueueAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("FailingEndpointAddress"); - - b.HasIndex("QueueAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("TrialMetadata"); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260724055947_AddConfiguration.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260724055947_AddConfiguration.cs deleted file mode 100644 index 6f816c4835..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260724055947_AddConfiguration.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class AddConfiguration : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "FailingEndpointAddress", - table: "FailedMessages", - type: "nvarchar(450)", - maxLength: 450, - nullable: false, - defaultValue: ""); - - migrationBuilder.CreateTable( - name: "EndpointSettings", - columns: table => new - { - Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - TrackInstances = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_EndpointSettings", x => x.Name); - }); - - migrationBuilder.CreateTable( - name: "TrialMetadata", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - TrialEndDate = table.Column(type: "date", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_TrialMetadata", x => x.Id); - }); - - migrationBuilder.InsertData( - table: "TrialMetadata", - columns: new[] { "Id", "TrialEndDate" }, - values: new object[] { 1, null }); - - migrationBuilder.CreateIndex( - name: "IX_FailedMessages_FailingEndpointAddress", - table: "FailedMessages", - column: "FailingEndpointAddress"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "EndpointSettings"); - - migrationBuilder.DropTable( - name: "TrialMetadata"); - - migrationBuilder.DropIndex( - name: "IX_FailedMessages_FailingEndpointAddress", - table: "FailedMessages"); - - migrationBuilder.DropColumn( - name: "FailingEndpointAddress", - table: "FailedMessages"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260728233017_AddFailedErrorImports.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260728233017_AddFailedErrorImports.Designer.cs deleted file mode 100644 index 518b0a56eb..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260728233017_AddFailedErrorImports.Designer.cs +++ /dev/null @@ -1,292 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260728233017_AddFailedErrorImports")] - partial class AddFailedErrorImports - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("TrackInstances") - .HasColumnType("bit"); - - b.HasKey("Name"); - - b.ToTable("EndpointSettings"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("Body") - .IsRequired() - .HasColumnType("varbinary(max)"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailedAt") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("FailedAt"); - - b.ToTable("FailedErrorImports"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FailingEndpointAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("QueueAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("FailingEndpointAddress"); - - b.HasIndex("QueueAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("TrialMetadata"); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260728233017_AddFailedErrorImports.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260728233017_AddFailedErrorImports.cs deleted file mode 100644 index 82ff157a93..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260728233017_AddFailedErrorImports.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class AddFailedErrorImports : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "FailedErrorImports", - columns: table => new - { - UniqueMessageId = table.Column(type: "uniqueidentifier", nullable: false), - FailedAt = table.Column(type: "datetime2", nullable: false), - MessageId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - HeadersJson = table.Column(type: "nvarchar(max)", nullable: false), - Body = table.Column(type: "varbinary(max)", nullable: false), - BodyStoredExternally = table.Column(type: "bit", nullable: false), - ExceptionInfo = table.Column(type: "nvarchar(max)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_FailedErrorImports", x => x.UniqueMessageId); - }); - - migrationBuilder.CreateIndex( - name: "IX_FailedErrorImports_FailedAt", - table: "FailedErrorImports", - column: "FailedAt"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "FailedErrorImports"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260729053622_AddSubscriptions.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260729053622_AddSubscriptions.Designer.cs deleted file mode 100644 index 2f268a7915..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260729053622_AddSubscriptions.Designer.cs +++ /dev/null @@ -1,312 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260729053622_AddSubscriptions")] - partial class AddSubscriptions - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("TrackInstances") - .HasColumnType("bit"); - - b.HasKey("Name"); - - b.ToTable("EndpointSettings"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("Body") - .IsRequired() - .HasColumnType("varbinary(max)"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailedAt") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("FailedAt"); - - b.ToTable("FailedErrorImports"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FailingEndpointAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("QueueAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("FailingEndpointAddress"); - - b.HasIndex("QueueAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("MessageType", "TransportAddress"); - - b.ToTable("Subscriptions"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("TrialMetadata"); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260729053622_AddSubscriptions.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260729053622_AddSubscriptions.cs deleted file mode 100644 index 9cb0ecdda4..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260729053622_AddSubscriptions.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class AddSubscriptions : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Subscriptions", - columns: table => new - { - MessageType = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - TransportAddress = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - Endpoint = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Subscriptions", x => new { x.MessageType, x.TransportAddress }); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Subscriptions"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731003301_DropDuplicateQueueAddress.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731003301_DropDuplicateQueueAddress.Designer.cs deleted file mode 100644 index 2d959177d0..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731003301_DropDuplicateQueueAddress.Designer.cs +++ /dev/null @@ -1,306 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260731003301_DropDuplicateQueueAddress")] - partial class DropDuplicateQueueAddress - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("TrackInstances") - .HasColumnType("bit"); - - b.HasKey("Name"); - - b.ToTable("EndpointSettings"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("Body") - .IsRequired() - .HasColumnType("varbinary(max)"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailedAt") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("FailedAt"); - - b.ToTable("FailedErrorImports"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FailingEndpointAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("FailingEndpointAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("MessageType", "TransportAddress"); - - b.ToTable("Subscriptions"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("TrialMetadata"); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731003301_DropDuplicateQueueAddress.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731003301_DropDuplicateQueueAddress.cs deleted file mode 100644 index 2694196c62..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731003301_DropDuplicateQueueAddress.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class DropDuplicateQueueAddress : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_FailedMessages_QueueAddress", - table: "FailedMessages"); - - migrationBuilder.DropColumn( - name: "QueueAddress", - table: "FailedMessages"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "QueueAddress", - table: "FailedMessages", - type: "nvarchar(450)", - maxLength: 450, - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_FailedMessages_QueueAddress", - table: "FailedMessages", - column: "QueueAddress"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731010345_EventLogItems.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731010345_EventLogItems.Designer.cs deleted file mode 100644 index 4b16d60ff9..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731010345_EventLogItems.Designer.cs +++ /dev/null @@ -1,352 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260731010345_EventLogItems")] - partial class EventLogItems - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("TrackInstances") - .HasColumnType("bit"); - - b.HasKey("Name"); - - b.ToTable("EndpointSettings"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RaisedAt") - .HasColumnType("datetime2"); - - b.PrimitiveCollection("RelatedTo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Severity") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending(); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("Body") - .IsRequired() - .HasColumnType("varbinary(max)"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailedAt") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("FailedAt"); - - b.ToTable("FailedErrorImports"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FailingEndpointAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("QueueAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("FailingEndpointAddress"); - - b.HasIndex("QueueAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("MessageType", "TransportAddress"); - - b.ToTable("Subscriptions"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("TrialMetadata"); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731010345_EventLogItems.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731010345_EventLogItems.cs deleted file mode 100644 index eea4e40e35..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731010345_EventLogItems.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class EventLogItems : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "EventLogItems", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Description = table.Column(type: "nvarchar(max)", nullable: false), - Severity = table.Column(type: "int", nullable: false), - RaisedAt = table.Column(type: "datetime2", nullable: false), - RelatedTo = table.Column(type: "nvarchar(max)", nullable: false), - Category = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - EventType = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_EventLogItems", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_EventLogItems_RaisedAt_Id", - table: "EventLogItems", - columns: new[] { "RaisedAt", "Id" }, - descending: new bool[0]); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "EventLogItems"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731043129_AddFailureGroupClassifierIndex.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731043129_AddFailureGroupClassifierIndex.Designer.cs deleted file mode 100644 index 7418ae7263..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731043129_AddFailureGroupClassifierIndex.Designer.cs +++ /dev/null @@ -1,308 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260731043129_AddFailureGroupClassifierIndex")] - partial class AddFailureGroupClassifierIndex - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("TrackInstances") - .HasColumnType("bit"); - - b.HasKey("Name"); - - b.ToTable("EndpointSettings"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("Body") - .IsRequired() - .HasColumnType("varbinary(max)"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailedAt") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("FailedAt"); - - b.ToTable("FailedErrorImports"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FailingEndpointAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("FailingEndpointAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.HasIndex("Type", "GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("MessageType", "TransportAddress"); - - b.ToTable("Subscriptions"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("TrialMetadata"); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731043129_AddFailureGroupClassifierIndex.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731043129_AddFailureGroupClassifierIndex.cs deleted file mode 100644 index eac954e32f..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731043129_AddFailureGroupClassifierIndex.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class AddFailureGroupClassifierIndex : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateIndex( - name: "IX_FailedMessageGroups_Type_GroupId", - table: "FailedMessageGroups", - columns: new[] { "Type", "GroupId" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_FailedMessageGroups_Type_GroupId", - table: "FailedMessageGroups"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731043442_NullableEndpointAddress.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731043442_NullableEndpointAddress.Designer.cs deleted file mode 100644 index 9d62f4d63e..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731043442_NullableEndpointAddress.Designer.cs +++ /dev/null @@ -1,351 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260731043442_NullableEndpointAddress")] - partial class NullableEndpointAddress - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("TrackInstances") - .HasColumnType("bit"); - - b.HasKey("Name"); - - b.ToTable("EndpointSettings"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RaisedAt") - .HasColumnType("datetime2"); - - b.PrimitiveCollection("RelatedTo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Severity") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending(); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("Body") - .IsRequired() - .HasColumnType("varbinary(max)"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailedAt") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("FailedAt"); - - b.ToTable("FailedErrorImports"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("QueueAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("FailingEndpointAddress"); - - b.HasIndex("QueueAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("MessageType", "TransportAddress"); - - b.ToTable("Subscriptions"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("TrialMetadata"); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731043442_NullableEndpointAddress.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731043442_NullableEndpointAddress.cs deleted file mode 100644 index 9e848d7562..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260731043442_NullableEndpointAddress.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class NullableEndpointAddress : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "FailingEndpointAddress", - table: "FailedMessages", - type: "nvarchar(450)", - maxLength: 450, - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(450)", - oldMaxLength: 450); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "FailingEndpointAddress", - table: "FailedMessages", - type: "nvarchar(450)", - maxLength: 450, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "nvarchar(450)", - oldMaxLength: 450, - oldNullable: true); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260801000400_AddGroupComments.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260801000400_AddGroupComments.Designer.cs deleted file mode 100644 index 336689eca6..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260801000400_AddGroupComments.Designer.cs +++ /dev/null @@ -1,362 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260801000400_AddGroupComments")] - partial class AddGroupComments - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("TrackInstances") - .HasColumnType("bit"); - - b.HasKey("Name"); - - b.ToTable("EndpointSettings"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RaisedAt") - .HasColumnType("datetime2"); - - b.PrimitiveCollection("RelatedTo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Severity") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending(); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("Body") - .IsRequired() - .HasColumnType("varbinary(max)"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailedAt") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("FailedAt"); - - b.ToTable("FailedErrorImports"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("FailingEndpointAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.HasIndex("Type", "GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.GroupCommentEntity", b => - { - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("GroupId"); - - b.ToTable("GroupComments"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("MessageType", "TransportAddress"); - - b.ToTable("Subscriptions"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("TrialMetadata"); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260801000400_AddGroupComments.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260801000400_AddGroupComments.cs deleted file mode 100644 index 9e612c113c..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260801000400_AddGroupComments.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class AddGroupComments : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "GroupComments", - columns: table => new - { - GroupId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - Comment = table.Column(type: "nvarchar(max)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_GroupComments", x => x.GroupId); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "GroupComments"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260802023134_AddMessageRedirects.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260802023134_AddMessageRedirects.Designer.cs deleted file mode 100644 index 816f0dd38d..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260802023134_AddMessageRedirects.Designer.cs +++ /dev/null @@ -1,381 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260802023134_AddMessageRedirects")] - partial class AddMessageRedirects - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("TrackInstances") - .HasColumnType("bit"); - - b.HasKey("Name"); - - b.ToTable("EndpointSettings"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RaisedAt") - .HasColumnType("datetime2"); - - b.PrimitiveCollection("RelatedTo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Severity") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending(); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("Body") - .IsRequired() - .HasColumnType("varbinary(max)"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailedAt") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("FailedAt"); - - b.ToTable("FailedErrorImports"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("FailingEndpointAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.HasIndex("Type", "GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.GroupCommentEntity", b => - { - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("GroupId"); - - b.ToTable("GroupComments"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.MessageRedirectEntity", b => - { - b.Property("FromPhysicalAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("ToPhysicalAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("FromPhysicalAddress"); - - b.ToTable("MessageRedirects"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("MessageType", "TransportAddress"); - - b.ToTable("Subscriptions"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("TrialMetadata"); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260802023134_AddMessageRedirects.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260802023134_AddMessageRedirects.cs deleted file mode 100644 index 51b4a7a177..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260802023134_AddMessageRedirects.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class AddMessageRedirects : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "MessageRedirects", - columns: table => new - { - FromPhysicalAddress = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - ToPhysicalAddress = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - LastModified = table.Column(type: "datetime2", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_MessageRedirects", x => x.FromPhysicalAddress); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "MessageRedirects"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260803021009_AddRetryBatches.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260803021009_AddRetryBatches.Designer.cs deleted file mode 100644 index 67a66855a7..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260803021009_AddRetryBatches.Designer.cs +++ /dev/null @@ -1,459 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260803021009_AddRetryBatches")] - partial class AddRetryBatches - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("TrackInstances") - .HasColumnType("bit"); - - b.HasKey("Name"); - - b.ToTable("EndpointSettings"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RaisedAt") - .HasColumnType("datetime2"); - - b.PrimitiveCollection("RelatedTo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Severity") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending(); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("Body") - .IsRequired() - .HasColumnType("varbinary(max)"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailedAt") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("FailedAt"); - - b.ToTable("FailedErrorImports"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("FailingEndpointAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.HasIndex("Type", "GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryBatchId") - .HasColumnType("uniqueidentifier"); - - b.Property("StageAttempts") - .HasColumnType("int"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("RetryBatchId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.GroupCommentEntity", b => - { - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("GroupId"); - - b.ToTable("GroupComments"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.MessageRedirectEntity", b => - { - b.Property("FromPhysicalAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("ToPhysicalAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("FromPhysicalAddress"); - - b.ToTable("MessageRedirects"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Classifier") - .HasColumnType("nvarchar(max)"); - - b.Property("Context") - .HasColumnType("nvarchar(max)"); - - b.Property("InitialBatchSize") - .HasColumnType("int"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("InitiatedByName") - .HasColumnType("nvarchar(max)"); - - b.Property("Last") - .HasColumnType("datetime2"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Originator") - .HasColumnType("nvarchar(max)"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RetrySessionId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RetryType") - .HasColumnType("int"); - - b.Property("StagingId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("StartTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("Status", "RetrySessionId"); - - b.ToTable("RetryBatches"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchNowForwardingEntity", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("RetryBatchId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.ToTable("RetryBatchNowForwarding"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("MessageType", "TransportAddress"); - - b.ToTable("Subscriptions"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("TrialMetadata"); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260803021009_AddRetryBatches.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260803021009_AddRetryBatches.cs deleted file mode 100644 index 5952ccc0e3..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260803021009_AddRetryBatches.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class AddRetryBatches : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "RetryId", - table: "FailedMessageRetries"); - - migrationBuilder.AddColumn( - name: "RetryBatchId", - table: "FailedMessageRetries", - type: "uniqueidentifier", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.AddColumn( - name: "StageAttempts", - table: "FailedMessageRetries", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.CreateTable( - name: "RetryBatches", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Status = table.Column(type: "int", nullable: false), - RetrySessionId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - RequestId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - RetryType = table.Column(type: "int", nullable: false), - InitialBatchSize = table.Column(type: "int", nullable: false), - StartTime = table.Column(type: "datetime2", nullable: false), - Last = table.Column(type: "datetime2", nullable: true), - StagingId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Context = table.Column(type: "nvarchar(max)", nullable: true), - Originator = table.Column(type: "nvarchar(max)", nullable: true), - Classifier = table.Column(type: "nvarchar(max)", nullable: true), - InitiatedById = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - InitiatedByName = table.Column(type: "nvarchar(max)", nullable: true), - OperationId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_RetryBatches", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "RetryBatchNowForwarding", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - RetryBatchId = table.Column(type: "uniqueidentifier", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_RetryBatchNowForwarding", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_FailedMessageRetries_RetryBatchId", - table: "FailedMessageRetries", - column: "RetryBatchId"); - - migrationBuilder.CreateIndex( - name: "IX_RetryBatches_Status_RetrySessionId", - table: "RetryBatches", - columns: new[] { "Status", "RetrySessionId" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "RetryBatches"); - - migrationBuilder.DropTable( - name: "RetryBatchNowForwarding"); - - migrationBuilder.DropIndex( - name: "IX_FailedMessageRetries_RetryBatchId", - table: "FailedMessageRetries"); - - migrationBuilder.DropColumn( - name: "RetryBatchId", - table: "FailedMessageRetries"); - - migrationBuilder.DropColumn( - name: "StageAttempts", - table: "FailedMessageRetries"); - - migrationBuilder.AddColumn( - name: "RetryId", - table: "FailedMessageRetries", - type: "nvarchar(450)", - maxLength: 450, - nullable: true); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260804052028_AddArchiveEntities.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260804052028_AddArchiveEntities.Designer.cs deleted file mode 100644 index 7e6a395cdf..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260804052028_AddArchiveEntities.Designer.cs +++ /dev/null @@ -1,551 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260804052028_AddArchiveEntities")] - partial class AddArchiveEntities - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.ArchiveOperationEntity", b => - { - b.Property("RequestId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ArchiveType") - .HasColumnType("int"); - - b.Property("OperationType") - .HasColumnType("int"); - - b.Property("CurrentBatch") - .HasColumnType("int"); - - b.Property("GroupName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("InitiatedByName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("NumberOfBatches") - .HasColumnType("int"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("int"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Started") - .HasColumnType("datetime2"); - - b.Property("TotalNumberOfMessages") - .HasColumnType("int"); - - b.HasKey("RequestId", "ArchiveType", "OperationType"); - - b.HasIndex("Started"); - - b.ToTable("ArchiveOperations"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.CustomCheckEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Category") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CustomCheckId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailureReason") - .HasColumnType("nvarchar(max)"); - - b.Property("OriginatingEndpointHost") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("OriginatingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("OriginatingEndpointName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ReportedAt") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ReportedAt"); - - b.HasIndex("Status", "ReportedAt"); - - b.ToTable("CustomChecks"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("TrackInstances") - .HasColumnType("bit"); - - b.HasKey("Name"); - - b.ToTable("EndpointSettings"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RaisedAt") - .HasColumnType("datetime2"); - - b.PrimitiveCollection("RelatedTo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Severity") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending(); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("Body") - .IsRequired() - .HasColumnType("varbinary(max)"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailedAt") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("FailedAt"); - - b.ToTable("FailedErrorImports"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("FailingEndpointAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.HasIndex("Type", "GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryBatchId") - .HasColumnType("uniqueidentifier"); - - b.Property("StageAttempts") - .HasColumnType("int"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("RetryBatchId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.GroupCommentEntity", b => - { - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("GroupId"); - - b.ToTable("GroupComments"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.MessageRedirectEntity", b => - { - b.Property("FromPhysicalAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("ToPhysicalAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("FromPhysicalAddress"); - - b.ToTable("MessageRedirects"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Classifier") - .HasColumnType("nvarchar(max)"); - - b.Property("Context") - .HasColumnType("nvarchar(max)"); - - b.Property("InitialBatchSize") - .HasColumnType("int"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("InitiatedByName") - .HasColumnType("nvarchar(max)"); - - b.Property("Last") - .HasColumnType("datetime2"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Originator") - .HasColumnType("nvarchar(max)"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RetrySessionId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RetryType") - .HasColumnType("int"); - - b.Property("StagingId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("StartTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("Status", "RetrySessionId"); - - b.ToTable("RetryBatches"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchNowForwardingEntity", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("RetryBatchId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.ToTable("RetryBatchNowForwarding"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("MessageType", "TransportAddress"); - - b.ToTable("Subscriptions"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("TrialMetadata"); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260804052028_AddArchiveEntities.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260804052028_AddArchiveEntities.cs deleted file mode 100644 index b9b4044806..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260804052028_AddArchiveEntities.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class AddArchiveEntities : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "ArchiveOperations", - columns: table => new - { - RequestId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), - ArchiveType = table.Column(type: "int", nullable: false), - OperationType = table.Column(type: "int", nullable: false), - GroupName = table.Column(type: "nvarchar(max)", nullable: false), - TotalNumberOfMessages = table.Column(type: "int", nullable: false), - NumberOfMessagesProcessed = table.Column(type: "int", nullable: false), - NumberOfBatches = table.Column(type: "int", nullable: false), - CurrentBatch = table.Column(type: "int", nullable: false), - Started = table.Column(type: "datetime2", nullable: false), - InitiatedById = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - InitiatedByName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - OperationId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ArchiveOperations", x => new { x.RequestId, x.ArchiveType, x.OperationType }); - }); - - migrationBuilder.CreateTable( - name: "CustomChecks", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - CustomCheckId = table.Column(type: "nvarchar(max)", nullable: false), - Category = table.Column(type: "nvarchar(max)", nullable: false), - Status = table.Column(type: "int", nullable: false), - ReportedAt = table.Column(type: "datetime2", nullable: false), - FailureReason = table.Column(type: "nvarchar(max)", nullable: true), - OriginatingEndpointName = table.Column(type: "nvarchar(max)", nullable: false), - OriginatingEndpointHostId = table.Column(type: "uniqueidentifier", nullable: false), - OriginatingEndpointHost = table.Column(type: "nvarchar(max)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_CustomChecks", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_ArchiveOperations_Started", - table: "ArchiveOperations", - column: "Started"); - - migrationBuilder.CreateIndex( - name: "IX_CustomChecks_ReportedAt", - table: "CustomChecks", - column: "ReportedAt"); - - migrationBuilder.CreateIndex( - name: "IX_CustomChecks_Status_ReportedAt", - table: "CustomChecks", - columns: new[] { "Status", "ReportedAt" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ArchiveOperations"); - - migrationBuilder.DropTable( - name: "CustomChecks"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260804222033_AddRetryHistory.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260804222033_AddRetryHistory.Designer.cs deleted file mode 100644 index 2a21d7a2ed..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260804222033_AddRetryHistory.Designer.cs +++ /dev/null @@ -1,576 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260804222033_AddRetryHistory")] - partial class AddRetryHistory - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.CustomCheckEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Category") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CustomCheckId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailureReason") - .HasColumnType("nvarchar(max)"); - - b.Property("OriginatingEndpointHost") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("OriginatingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("OriginatingEndpointName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ReportedAt") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ReportedAt"); - - b.HasIndex("Status", "ReportedAt"); - - b.ToTable("CustomChecks"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("TrackInstances") - .HasColumnType("bit"); - - b.HasKey("Name"); - - b.ToTable("EndpointSettings"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RaisedAt") - .HasColumnType("datetime2"); - - b.PrimitiveCollection("RelatedTo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Severity") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending(); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("Body") - .IsRequired() - .HasColumnType("varbinary(max)"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailedAt") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("FailedAt"); - - b.ToTable("FailedErrorImports"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("FailingEndpointAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.HasIndex("Type", "GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryBatchId") - .HasColumnType("uniqueidentifier"); - - b.Property("StageAttempts") - .HasColumnType("int"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("RetryBatchId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.GroupCommentEntity", b => - { - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("GroupId"); - - b.ToTable("GroupComments"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.HistoricRetryOperationEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CompletionTime") - .HasColumnType("datetime2"); - - b.Property("Failed") - .HasColumnType("bit"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("int"); - - b.Property("Originator") - .HasColumnType("nvarchar(max)"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(400) - .HasColumnType("nvarchar(400)"); - - b.Property("RetryType") - .HasColumnType("int"); - - b.Property("StartTime") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CompletionTime", "Id") - .IsDescending(); - - b.ToTable("HistoricRetryOperations"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.MessageRedirectEntity", b => - { - b.Property("FromPhysicalAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("ToPhysicalAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("FromPhysicalAddress"); - - b.ToTable("MessageRedirects"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Classifier") - .HasColumnType("nvarchar(max)"); - - b.Property("Context") - .HasColumnType("nvarchar(max)"); - - b.Property("InitialBatchSize") - .HasColumnType("int"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("InitiatedByName") - .HasColumnType("nvarchar(max)"); - - b.Property("Last") - .HasColumnType("datetime2"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Originator") - .HasColumnType("nvarchar(max)"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RetrySessionId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RetryType") - .HasColumnType("int"); - - b.Property("StagingId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("StartTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("Status", "RetrySessionId"); - - b.ToTable("RetryBatches"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchNowForwardingEntity", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("RetryBatchId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.ToTable("RetryBatchNowForwarding"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("MessageType", "TransportAddress"); - - b.ToTable("Subscriptions"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.TrialMetadataEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("TrialEndDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("TrialMetadata"); - - b.HasData( - new - { - Id = 1 - }); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.UnacknowledgedRetryOperationEntity", b => - { - b.Property("RequestId") - .HasMaxLength(400) - .HasColumnType("nvarchar(400)"); - - b.Property("RetryType") - .HasColumnType("int"); - - b.Property("Classifier") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("CompletionTime") - .HasColumnType("datetime2"); - - b.Property("Failed") - .HasColumnType("bit"); - - b.Property("Last") - .HasColumnType("datetime2"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("int"); - - b.Property("Originator") - .HasColumnType("nvarchar(max)"); - - b.Property("StartTime") - .HasColumnType("datetime2"); - - b.HasKey("RequestId", "RetryType"); - - b.ToTable("UnacknowledgedRetryOperations"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260804222033_AddRetryHistory.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260804222033_AddRetryHistory.cs deleted file mode 100644 index 1492468775..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260804222033_AddRetryHistory.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class AddRetryHistory : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "HistoricRetryOperations", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - RequestId = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), - RetryType = table.Column(type: "int", nullable: false), - StartTime = table.Column(type: "datetime2", nullable: false), - CompletionTime = table.Column(type: "datetime2", nullable: false), - Originator = table.Column(type: "nvarchar(max)", nullable: true), - Failed = table.Column(type: "bit", nullable: false), - NumberOfMessagesProcessed = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_HistoricRetryOperations", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "UnacknowledgedRetryOperations", - columns: table => new - { - RequestId = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), - RetryType = table.Column(type: "int", nullable: false), - StartTime = table.Column(type: "datetime2", nullable: false), - CompletionTime = table.Column(type: "datetime2", nullable: false), - Last = table.Column(type: "datetime2", nullable: false), - Originator = table.Column(type: "nvarchar(max)", nullable: true), - Classifier = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - Failed = table.Column(type: "bit", nullable: false), - NumberOfMessagesProcessed = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_UnacknowledgedRetryOperations", x => new { x.RequestId, x.RetryType }); - }); - - migrationBuilder.CreateIndex( - name: "IX_HistoricRetryOperations_CompletionTime_Id", - table: "HistoricRetryOperations", - columns: new[] { "CompletionTime", "Id" }, - descending: new bool[0]); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "HistoricRetryOperations"); - - migrationBuilder.DropTable( - name: "UnacknowledgedRetryOperations"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260807012017_AddSettings.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260807012017_AddSettings.Designer.cs deleted file mode 100644 index d5620906e1..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260807012017_AddSettings.Designer.cs +++ /dev/null @@ -1,619 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260807012017_AddSettings")] - partial class AddSettings - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.ArchiveOperationEntity", b => - { - b.Property("RequestId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ArchiveType") - .HasColumnType("int"); - - b.Property("OperationType") - .HasColumnType("int"); - - b.Property("CurrentBatch") - .HasColumnType("int"); - - b.Property("GroupName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("InitiatedByName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("NumberOfBatches") - .HasColumnType("int"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("int"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Started") - .HasColumnType("datetime2"); - - b.Property("TotalNumberOfMessages") - .HasColumnType("int"); - - b.HasKey("RequestId", "ArchiveType", "OperationType"); - - b.HasIndex("Started"); - - b.ToTable("ArchiveOperations"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.CustomCheckEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Category") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CustomCheckId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailureReason") - .HasColumnType("nvarchar(max)"); - - b.Property("OriginatingEndpointHost") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("OriginatingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("OriginatingEndpointName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ReportedAt") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ReportedAt"); - - b.HasIndex("Status", "ReportedAt"); - - b.ToTable("CustomChecks"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("TrackInstances") - .HasColumnType("bit"); - - b.HasKey("Name"); - - b.ToTable("EndpointSettings"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RaisedAt") - .HasColumnType("datetime2"); - - b.PrimitiveCollection("RelatedTo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Severity") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending(); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("Body") - .IsRequired() - .HasColumnType("varbinary(max)"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailedAt") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("FailedAt"); - - b.ToTable("FailedErrorImports"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("FailingEndpointAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.HasIndex("Type", "GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryBatchId") - .HasColumnType("uniqueidentifier"); - - b.Property("StageAttempts") - .HasColumnType("int"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("RetryBatchId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.GroupCommentEntity", b => - { - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("GroupId"); - - b.ToTable("GroupComments"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.HistoricRetryOperationEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CompletionTime") - .HasColumnType("datetime2"); - - b.Property("Failed") - .HasColumnType("bit"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("int"); - - b.Property("Originator") - .HasColumnType("nvarchar(max)"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(400) - .HasColumnType("nvarchar(400)"); - - b.Property("RetryType") - .HasColumnType("int"); - - b.Property("StartTime") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CompletionTime", "Id") - .IsDescending(); - - b.ToTable("HistoricRetryOperations"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.MessageRedirectEntity", b => - { - b.Property("FromPhysicalAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("ToPhysicalAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("FromPhysicalAddress"); - - b.ToTable("MessageRedirects"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Classifier") - .HasColumnType("nvarchar(max)"); - - b.Property("Context") - .HasColumnType("nvarchar(max)"); - - b.Property("InitialBatchSize") - .HasColumnType("int"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("InitiatedByName") - .HasColumnType("nvarchar(max)"); - - b.Property("Last") - .HasColumnType("datetime2"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Originator") - .HasColumnType("nvarchar(max)"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RetrySessionId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RetryType") - .HasColumnType("int"); - - b.Property("StagingId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("StartTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("Status", "RetrySessionId"); - - b.ToTable("RetryBatches"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchNowForwardingEntity", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("RetryBatchId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.ToTable("RetryBatchNowForwarding"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SettingEntity", b => - { - b.Property("Key") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Key"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("MessageType", "TransportAddress"); - - b.ToTable("Subscriptions"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.UnacknowledgedRetryOperationEntity", b => - { - b.Property("RequestId") - .HasMaxLength(400) - .HasColumnType("nvarchar(400)"); - - b.Property("RetryType") - .HasColumnType("int"); - - b.Property("Classifier") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("CompletionTime") - .HasColumnType("datetime2"); - - b.Property("Failed") - .HasColumnType("bit"); - - b.Property("Last") - .HasColumnType("datetime2"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("int"); - - b.Property("Originator") - .HasColumnType("nvarchar(max)"); - - b.Property("StartTime") - .HasColumnType("datetime2"); - - b.HasKey("RequestId", "RetryType"); - - b.ToTable("UnacknowledgedRetryOperations"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260807012017_AddSettings.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260807012017_AddSettings.cs deleted file mode 100644 index 3266bf9c48..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260807012017_AddSettings.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class AddSettings : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "TrialMetadata"); - - migrationBuilder.CreateTable( - name: "Settings", - columns: table => new - { - Key = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Value = table.Column(type: "nvarchar(max)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Settings", x => x.Key); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Settings"); - - migrationBuilder.CreateTable( - name: "TrialMetadata", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - TrialEndDate = table.Column(type: "date", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_TrialMetadata", x => x.Id); - }); - - migrationBuilder.InsertData( - table: "TrialMetadata", - columns: new[] { "Id", "TrialEndDate" }, - values: new object[] { 1, null }); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260807053830_AddLicensingThroughput.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260807053830_AddLicensingThroughput.Designer.cs deleted file mode 100644 index ea0b7881a8..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260807053830_AddLicensingThroughput.Designer.cs +++ /dev/null @@ -1,694 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260807053830_AddLicensingThroughput")] - partial class AddLicensingThroughput - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.ArchiveOperationEntity", b => - { - b.Property("RequestId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ArchiveType") - .HasColumnType("int"); - - b.Property("OperationType") - .HasColumnType("int"); - - b.Property("CurrentBatch") - .HasColumnType("int"); - - b.Property("GroupName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("InitiatedByName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("NumberOfBatches") - .HasColumnType("int"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("int"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Started") - .HasColumnType("datetime2"); - - b.Property("TotalNumberOfMessages") - .HasColumnType("int"); - - b.HasKey("RequestId", "ArchiveType", "OperationType"); - - b.HasIndex("Started"); - - b.ToTable("ArchiveOperations"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.CustomCheckEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Category") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CustomCheckId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailureReason") - .HasColumnType("nvarchar(max)"); - - b.Property("OriginatingEndpointHost") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("OriginatingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("OriginatingEndpointName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ReportedAt") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ReportedAt"); - - b.HasIndex("Status", "ReportedAt"); - - b.ToTable("CustomChecks"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("TrackInstances") - .HasColumnType("bit"); - - b.HasKey("Name"); - - b.ToTable("EndpointSettings"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RaisedAt") - .HasColumnType("datetime2"); - - b.PrimitiveCollection("RelatedTo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Severity") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending(); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("Body") - .IsRequired() - .HasColumnType("varbinary(max)"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailedAt") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("FailedAt"); - - b.ToTable("FailedErrorImports"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("FailingEndpointAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.HasIndex("Type", "GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryBatchId") - .HasColumnType("uniqueidentifier"); - - b.Property("StageAttempts") - .HasColumnType("int"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("RetryBatchId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.GroupCommentEntity", b => - { - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("GroupId"); - - b.ToTable("GroupComments"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.HistoricRetryOperationEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CompletionTime") - .HasColumnType("datetime2"); - - b.Property("Failed") - .HasColumnType("bit"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("int"); - - b.Property("Originator") - .HasColumnType("nvarchar(max)"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(400) - .HasColumnType("nvarchar(400)"); - - b.Property("RetryType") - .HasColumnType("int"); - - b.Property("StartTime") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CompletionTime", "Id") - .IsDescending(); - - b.ToTable("HistoricRetryOperations"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.LicensingEndpointEntity", b => - { - b.Property("NormalizedName") - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("ThroughputSource") - .HasColumnType("int"); - - b.PrimitiveCollection("EndpointIndicators") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("NormalizedSanitizedName") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SanitizedName") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Scope") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("UserIndicator") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("NormalizedName", "ThroughputSource"); - - b.HasIndex("NormalizedSanitizedName"); - - b.ToTable("LicensingEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.LicensingEndpointThroughputEntity", b => - { - b.Property("NormalizedName") - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("ThroughputSource") - .HasColumnType("int"); - - b.Property("DateUtc") - .HasColumnType("date"); - - b.Property("MessageCount") - .HasColumnType("bigint"); - - b.HasKey("NormalizedName", "ThroughputSource", "DateUtc"); - - b.HasIndex("DateUtc"); - - b.ToTable("LicensingEndpointThroughput"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.MessageRedirectEntity", b => - { - b.Property("FromPhysicalAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("ToPhysicalAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("FromPhysicalAddress"); - - b.ToTable("MessageRedirects"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Classifier") - .HasColumnType("nvarchar(max)"); - - b.Property("Context") - .HasColumnType("nvarchar(max)"); - - b.Property("InitialBatchSize") - .HasColumnType("int"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("InitiatedByName") - .HasColumnType("nvarchar(max)"); - - b.Property("Last") - .HasColumnType("datetime2"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Originator") - .HasColumnType("nvarchar(max)"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RetrySessionId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RetryType") - .HasColumnType("int"); - - b.Property("StagingId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("StartTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("Status", "RetrySessionId"); - - b.ToTable("RetryBatches"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchNowForwardingEntity", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("RetryBatchId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.ToTable("RetryBatchNowForwarding"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SettingEntity", b => - { - b.Property("Key") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Key"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("MessageType", "TransportAddress"); - - b.ToTable("Subscriptions"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.UnacknowledgedRetryOperationEntity", b => - { - b.Property("RequestId") - .HasMaxLength(400) - .HasColumnType("nvarchar(400)"); - - b.Property("RetryType") - .HasColumnType("int"); - - b.Property("Classifier") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("CompletionTime") - .HasColumnType("datetime2"); - - b.Property("Failed") - .HasColumnType("bit"); - - b.Property("Last") - .HasColumnType("datetime2"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("int"); - - b.Property("Originator") - .HasColumnType("nvarchar(max)"); - - b.Property("StartTime") - .HasColumnType("datetime2"); - - b.HasKey("RequestId", "RetryType"); - - b.ToTable("UnacknowledgedRetryOperations"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.LicensingEndpointThroughputEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.LicensingEndpointEntity", null) - .WithMany() - .HasForeignKey("NormalizedName", "ThroughputSource") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260807053830_AddLicensingThroughput.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260807053830_AddLicensingThroughput.cs deleted file mode 100644 index 6ce091ffe3..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260807053830_AddLicensingThroughput.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class AddLicensingThroughput : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "LicensingEndpoints", - columns: table => new - { - NormalizedName = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: false), - ThroughputSource = table.Column(type: "int", nullable: false), - Name = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: false), - SanitizedName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - NormalizedSanitizedName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - UserIndicator = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - Scope = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), - EndpointIndicators = table.Column(type: "nvarchar(max)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_LicensingEndpoints", x => new { x.NormalizedName, x.ThroughputSource }); - }); - - migrationBuilder.CreateTable( - name: "LicensingEndpointThroughput", - columns: table => new - { - NormalizedName = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: false), - ThroughputSource = table.Column(type: "int", nullable: false), - DateUtc = table.Column(type: "date", nullable: false), - MessageCount = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_LicensingEndpointThroughput", x => new { x.NormalizedName, x.ThroughputSource, x.DateUtc }); - table.ForeignKey( - name: "FK_LicensingEndpointThroughput_LicensingEndpoints_NormalizedName_ThroughputSource", - columns: x => new { x.NormalizedName, x.ThroughputSource }, - principalTable: "LicensingEndpoints", - principalColumns: new[] { "NormalizedName", "ThroughputSource" }, - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_LicensingEndpoints_NormalizedSanitizedName", - table: "LicensingEndpoints", - column: "NormalizedSanitizedName"); - - migrationBuilder.CreateIndex( - name: "IX_LicensingEndpointThroughput_DateUtc", - table: "LicensingEndpointThroughput", - column: "DateUtc"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "LicensingEndpointThroughput"); - - migrationBuilder.DropTable( - name: "LicensingEndpoints"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260811010033_AddFailedMessageEdits.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260811010033_AddFailedMessageEdits.Designer.cs deleted file mode 100644 index 657232d9f3..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260811010033_AddFailedMessageEdits.Designer.cs +++ /dev/null @@ -1,711 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ServiceControl.Persistence.EFCore.SqlServer; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260811010033_AddFailedMessageEdits")] - partial class AddFailedMessageEdits - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.ArchiveOperationEntity", b => - { - b.Property("RequestId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("ArchiveType") - .HasColumnType("int"); - - b.Property("OperationType") - .HasColumnType("int"); - - b.Property("CurrentBatch") - .HasColumnType("int"); - - b.Property("GroupName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("InitiatedByName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("NumberOfBatches") - .HasColumnType("int"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("int"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Started") - .HasColumnType("datetime2"); - - b.Property("TotalNumberOfMessages") - .HasColumnType("int"); - - b.HasKey("RequestId", "ArchiveType", "OperationType"); - - b.HasIndex("Started"); - - b.ToTable("ArchiveOperations"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.CustomCheckEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Category") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CustomCheckId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailureReason") - .HasColumnType("nvarchar(max)"); - - b.Property("OriginatingEndpointHost") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("OriginatingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("OriginatingEndpointName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ReportedAt") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ReportedAt"); - - b.HasIndex("Status", "ReportedAt"); - - b.ToTable("CustomChecks"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EndpointSettingsEntity", b => - { - b.Property("Name") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("TrackInstances") - .HasColumnType("bit"); - - b.HasKey("Name"); - - b.ToTable("EndpointSettings"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.EventLogItemEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Category") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("EventType") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RaisedAt") - .HasColumnType("datetime2"); - - b.PrimitiveCollection("RelatedTo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Severity") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RaisedAt", "Id") - .IsDescending(); - - b.ToTable("EventLogItems", (string)null); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("Body") - .IsRequired() - .HasColumnType("varbinary(max)"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("ExceptionInfo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FailedAt") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("MessageId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("FailedAt"); - - b.ToTable("FailedErrorImports"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEditEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("EditId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("EditId"); - - b.ToTable("FailedMessageEdits"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("BodyContentType") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("BodySize") - .HasColumnType("int"); - - b.Property("BodyStoredExternally") - .HasColumnType("bit"); - - b.Property("BodyText") - .HasColumnType("nvarchar(max)"); - - b.Property("ConversationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ExceptionMessage") - .HasColumnType("nvarchar(max)"); - - b.Property("ExceptionType") - .HasColumnType("nvarchar(max)"); - - b.Property("FailingEndpointAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("FirstTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("HeadersJson") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsSystemMessage") - .HasColumnType("bit"); - - b.Property("LastAttemptedAt") - .HasColumnType("datetime2"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastTimeOfFailure") - .HasColumnType("datetime2"); - - b.Property("MessageId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("MessageType") - .HasColumnType("nvarchar(max)"); - - b.Property("NumberOfProcessingAttempts") - .HasColumnType("int"); - - b.Property("ReceivingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("ReceivingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReceivingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHost") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SendingEndpointHostId") - .HasColumnType("uniqueidentifier"); - - b.Property("SendingEndpointName") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StatusChangedAt") - .HasColumnType("datetime2"); - - b.Property("TimeSent") - .HasColumnType("datetime2"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("ConversationId"); - - b.HasIndex("FailingEndpointAddress"); - - b.HasIndex("ReceivingEndpointName"); - - b.HasIndex("StatusChangedAt") - .HasFilter("[Status] IN (2, 4)"); - - b.HasIndex("TimeSent"); - - b.HasIndex("Status", "LastModified"); - - b.ToTable("FailedMessages"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.Property("FailedMessageUniqueId") - .HasColumnType("uniqueidentifier"); - - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("FailedMessageUniqueId", "GroupId"); - - b.HasIndex("GroupId"); - - b.HasIndex("Type", "GroupId"); - - b.ToTable("FailedMessageGroups"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageRetryEntity", b => - { - b.Property("UniqueMessageId") - .HasColumnType("uniqueidentifier"); - - b.Property("RetryBatchId") - .HasColumnType("uniqueidentifier"); - - b.Property("StageAttempts") - .HasColumnType("int"); - - b.HasKey("UniqueMessageId"); - - b.HasIndex("RetryBatchId"); - - b.ToTable("FailedMessageRetries"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.GroupCommentEntity", b => - { - b.Property("GroupId") - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("GroupId"); - - b.ToTable("GroupComments"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.HistoricRetryOperationEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CompletionTime") - .HasColumnType("datetime2"); - - b.Property("Failed") - .HasColumnType("bit"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("int"); - - b.Property("Originator") - .HasColumnType("nvarchar(max)"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(400) - .HasColumnType("nvarchar(400)"); - - b.Property("RetryType") - .HasColumnType("int"); - - b.Property("StartTime") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CompletionTime", "Id") - .IsDescending(); - - b.ToTable("HistoricRetryOperations"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.KnownEndpointEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Host") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("HostId") - .HasColumnType("uniqueidentifier"); - - b.Property("Monitored") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.ToTable("KnownEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.LicensingEndpointEntity", b => - { - b.Property("NormalizedName") - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("ThroughputSource") - .HasColumnType("int"); - - b.PrimitiveCollection("EndpointIndicators") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("NormalizedSanitizedName") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("SanitizedName") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Scope") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("UserIndicator") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("NormalizedName", "ThroughputSource"); - - b.HasIndex("NormalizedSanitizedName"); - - b.ToTable("LicensingEndpoints"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.LicensingEndpointThroughputEntity", b => - { - b.Property("NormalizedName") - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("ThroughputSource") - .HasColumnType("int"); - - b.Property("DateUtc") - .HasColumnType("date"); - - b.Property("MessageCount") - .HasColumnType("bigint"); - - b.HasKey("NormalizedName", "ThroughputSource", "DateUtc"); - - b.HasIndex("DateUtc"); - - b.ToTable("LicensingEndpointThroughput"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.MessageRedirectEntity", b => - { - b.Property("FromPhysicalAddress") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("ToPhysicalAddress") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("FromPhysicalAddress"); - - b.ToTable("MessageRedirects"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchEntity", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Classifier") - .HasColumnType("nvarchar(max)"); - - b.Property("Context") - .HasColumnType("nvarchar(max)"); - - b.Property("InitialBatchSize") - .HasColumnType("int"); - - b.Property("InitiatedById") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("InitiatedByName") - .HasColumnType("nvarchar(max)"); - - b.Property("Last") - .HasColumnType("datetime2"); - - b.Property("OperationId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Originator") - .HasColumnType("nvarchar(max)"); - - b.Property("RequestId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RetrySessionId") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("RetryType") - .HasColumnType("int"); - - b.Property("StagingId") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("StartTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("Status", "RetrySessionId"); - - b.ToTable("RetryBatches"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.RetryBatchNowForwardingEntity", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("RetryBatchId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.ToTable("RetryBatchNowForwarding"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SettingEntity", b => - { - b.Property("Key") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Key"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.SubscriptionEntity", b => - { - b.Property("MessageType") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("TransportAddress") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Endpoint") - .IsRequired() - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.HasKey("MessageType", "TransportAddress"); - - b.ToTable("Subscriptions"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.UnacknowledgedRetryOperationEntity", b => - { - b.Property("RequestId") - .HasMaxLength(400) - .HasColumnType("nvarchar(400)"); - - b.Property("RetryType") - .HasColumnType("int"); - - b.Property("Classifier") - .HasMaxLength(450) - .HasColumnType("nvarchar(450)"); - - b.Property("CompletionTime") - .HasColumnType("datetime2"); - - b.Property("Failed") - .HasColumnType("bit"); - - b.Property("Last") - .HasColumnType("datetime2"); - - b.Property("NumberOfMessagesProcessed") - .HasColumnType("int"); - - b.Property("Originator") - .HasColumnType("nvarchar(max)"); - - b.Property("StartTime") - .HasColumnType("datetime2"); - - b.HasKey("RequestId", "RetryType"); - - b.ToTable("UnacknowledgedRetryOperations"); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageGroupEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", null) - .WithMany() - .HasForeignKey("FailedMessageUniqueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.LicensingEndpointThroughputEntity", b => - { - b.HasOne("ServiceControl.Persistence.EFCore.Entities.LicensingEndpointEntity", null) - .WithMany() - .HasForeignKey("NormalizedName", "ThroughputSource") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260811010033_AddFailedMessageEdits.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260811010033_AddFailedMessageEdits.cs deleted file mode 100644 index acb3a1e25c..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260811010033_AddFailedMessageEdits.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class AddFailedMessageEdits : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "FailedMessageEdits", - columns: table => new - { - UniqueMessageId = table.Column(type: "uniqueidentifier", nullable: false), - EditId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_FailedMessageEdits", x => x.UniqueMessageId); - }); - - migrationBuilder.CreateIndex( - name: "IX_FailedMessageEdits_EditId", - table: "FailedMessageEdits", - column: "EditId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "FailedMessageEdits"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260811033208_AddExternalIntegrationDispatchRequests.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260811033208_AddExternalIntegrationDispatchRequests.cs deleted file mode 100644 index d4ab995bdd..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260811033208_AddExternalIntegrationDispatchRequests.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class AddExternalIntegrationDispatchRequests : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "ExternalIntegrationDispatchRequests", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - DispatchContextTypeName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), - DispatchContextJson = table.Column(type: "nvarchar(max)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ExternalIntegrationDispatchRequests", x => x.Id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ExternalIntegrationDispatchRequests"); - } - } -} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260812000000_MakeFailingEndpointAddressNonNull.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260812000000_MakeFailingEndpointAddressNonNull.cs deleted file mode 100644 index 1e65ce9e3c..0000000000 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260812000000_MakeFailingEndpointAddressNonNull.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations -{ - /// - public partial class MakeFailingEndpointAddressNonNull : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - // In practice no rows have a null FailingEndpointAddress — ingestion throws if the - // FailedQ header is missing — but defaultValue ensures any strays are cleaned up - // before the column is made NOT NULL. - migrationBuilder.AlterColumn( - name: "FailingEndpointAddress", - table: "FailedMessages", - type: "nvarchar(450)", - maxLength: 450, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "nvarchar(450)", - oldMaxLength: 450, - oldNullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "FailingEndpointAddress", - table: "FailedMessages", - type: "nvarchar(450)", - maxLength: 450, - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(450)", - oldMaxLength: 450); - } - } -} \ No newline at end of file diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260811033208_AddExternalIntegrationDispatchRequests.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221640_Initial.Designer.cs similarity index 97% rename from src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260811033208_AddExternalIntegrationDispatchRequests.Designer.cs rename to src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221640_Initial.Designer.cs index f504489855..c4e631848d 100644 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260811033208_AddExternalIntegrationDispatchRequests.Designer.cs +++ b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221640_Initial.Designer.cs @@ -12,15 +12,15 @@ namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations { [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260811033208_AddExternalIntegrationDispatchRequests")] - partial class AddExternalIntegrationDispatchRequests + [Migration("20260901221640_Initial")] + partial class Initial { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") + .HasAnnotation("ProductVersion", "10.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); @@ -228,6 +228,23 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("FailedErrorImports"); }); + modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEditEntity", b => + { + b.Property("UniqueMessageId") + .HasColumnType("uniqueidentifier"); + + b.Property("EditId") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("UniqueMessageId"); + + b.HasIndex("EditId"); + + b.ToTable("FailedMessageEdits"); + }); + modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedMessageEntity", b => { b.Property("UniqueMessageId") @@ -257,6 +274,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("nvarchar(max)"); b.Property("FailingEndpointAddress") + .IsRequired() .HasMaxLength(450) .HasColumnType("nvarchar(450)"); diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221640_Initial.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221640_Initial.cs new file mode 100644 index 0000000000..41db5921c6 --- /dev/null +++ b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221640_Initial.cs @@ -0,0 +1,542 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations +{ + /// + public partial class Initial : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "ArchiveOperations", + columns: table => new + { + RequestId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + ArchiveType = table.Column(type: "int", nullable: false), + OperationType = table.Column(type: "int", nullable: false), + GroupName = table.Column(type: "nvarchar(max)", nullable: false), + TotalNumberOfMessages = table.Column(type: "int", nullable: false), + NumberOfMessagesProcessed = table.Column(type: "int", nullable: false), + NumberOfBatches = table.Column(type: "int", nullable: false), + CurrentBatch = table.Column(type: "int", nullable: false), + Started = table.Column(type: "datetime2", nullable: false), + InitiatedById = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + InitiatedByName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + OperationId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_ArchiveOperations", x => new { x.RequestId, x.ArchiveType, x.OperationType }); + }); + + migrationBuilder.CreateTable( + name: "CustomChecks", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + CustomCheckId = table.Column(type: "nvarchar(max)", nullable: false), + Category = table.Column(type: "nvarchar(max)", nullable: false), + Status = table.Column(type: "int", nullable: false), + ReportedAt = table.Column(type: "datetime2", nullable: false), + FailureReason = table.Column(type: "nvarchar(max)", nullable: true), + OriginatingEndpointName = table.Column(type: "nvarchar(max)", nullable: false), + OriginatingEndpointHostId = table.Column(type: "uniqueidentifier", nullable: false), + OriginatingEndpointHost = table.Column(type: "nvarchar(max)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CustomChecks", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "EndpointSettings", + columns: table => new + { + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + TrackInstances = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_EndpointSettings", x => x.Name); + }); + + migrationBuilder.CreateTable( + name: "EventLogItems", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Description = table.Column(type: "nvarchar(max)", nullable: false), + Severity = table.Column(type: "int", nullable: false), + RaisedAt = table.Column(type: "datetime2", nullable: false), + RelatedTo = table.Column(type: "nvarchar(max)", nullable: false), + Category = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + EventType = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_EventLogItems", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "ExternalIntegrationDispatchRequests", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + DispatchContextTypeName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + DispatchContextJson = table.Column(type: "nvarchar(max)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ExternalIntegrationDispatchRequests", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "FailedErrorImports", + columns: table => new + { + UniqueMessageId = table.Column(type: "uniqueidentifier", nullable: false), + FailedAt = table.Column(type: "datetime2", nullable: false), + MessageId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + HeadersJson = table.Column(type: "nvarchar(max)", nullable: false), + Body = table.Column(type: "varbinary(max)", nullable: false), + BodyStoredExternally = table.Column(type: "bit", nullable: false), + ExceptionInfo = table.Column(type: "nvarchar(max)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_FailedErrorImports", x => x.UniqueMessageId); + }); + + migrationBuilder.CreateTable( + name: "FailedMessageEdits", + columns: table => new + { + UniqueMessageId = table.Column(type: "uniqueidentifier", nullable: false), + EditId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_FailedMessageEdits", x => x.UniqueMessageId); + }); + + migrationBuilder.CreateTable( + name: "FailedMessageRetries", + columns: table => new + { + UniqueMessageId = table.Column(type: "uniqueidentifier", nullable: false), + RetryBatchId = table.Column(type: "uniqueidentifier", nullable: false), + StageAttempts = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_FailedMessageRetries", x => x.UniqueMessageId); + }); + + migrationBuilder.CreateTable( + name: "FailedMessages", + columns: table => new + { + UniqueMessageId = table.Column(type: "uniqueidentifier", nullable: false), + Status = table.Column(type: "int", nullable: false), + StatusChangedAt = table.Column(type: "datetime2", nullable: false), + LastModified = table.Column(type: "datetime2", nullable: false), + NumberOfProcessingAttempts = table.Column(type: "int", nullable: false), + FirstTimeOfFailure = table.Column(type: "datetime2", nullable: false), + LastTimeOfFailure = table.Column(type: "datetime2", nullable: false), + LastAttemptedAt = table.Column(type: "datetime2", nullable: false), + MessageId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + MessageType = table.Column(type: "nvarchar(max)", nullable: true), + TimeSent = table.Column(type: "datetime2", nullable: true), + ConversationId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + SendingEndpointName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + SendingEndpointHostId = table.Column(type: "uniqueidentifier", nullable: true), + SendingEndpointHost = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + ReceivingEndpointName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + ReceivingEndpointHostId = table.Column(type: "uniqueidentifier", nullable: true), + ReceivingEndpointHost = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + ExceptionType = table.Column(type: "nvarchar(max)", nullable: true), + ExceptionMessage = table.Column(type: "nvarchar(max)", nullable: true), + IsSystemMessage = table.Column(type: "bit", nullable: false), + HeadersJson = table.Column(type: "nvarchar(max)", nullable: false), + BodyText = table.Column(type: "nvarchar(max)", nullable: true), + BodyStoredExternally = table.Column(type: "bit", nullable: false), + BodySize = table.Column(type: "int", nullable: false), + BodyContentType = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + FailingEndpointAddress = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_FailedMessages", x => x.UniqueMessageId); + }); + + migrationBuilder.CreateTable( + name: "GroupComments", + columns: table => new + { + GroupId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Comment = table.Column(type: "nvarchar(max)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_GroupComments", x => x.GroupId); + }); + + migrationBuilder.CreateTable( + name: "HistoricRetryOperations", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + RequestId = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), + RetryType = table.Column(type: "int", nullable: false), + StartTime = table.Column(type: "datetime2", nullable: false), + CompletionTime = table.Column(type: "datetime2", nullable: false), + Originator = table.Column(type: "nvarchar(max)", nullable: true), + Failed = table.Column(type: "bit", nullable: false), + NumberOfMessagesProcessed = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_HistoricRetryOperations", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "KnownEndpoints", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + HostId = table.Column(type: "uniqueidentifier", nullable: false), + Host = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Monitored = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_KnownEndpoints", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "LicensingEndpoints", + columns: table => new + { + NormalizedName = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: false), + ThroughputSource = table.Column(type: "int", nullable: false), + Name = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: false), + SanitizedName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + NormalizedSanitizedName = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + UserIndicator = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Scope = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + EndpointIndicators = table.Column(type: "nvarchar(max)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_LicensingEndpoints", x => new { x.NormalizedName, x.ThroughputSource }); + }); + + migrationBuilder.CreateTable( + name: "MessageRedirects", + columns: table => new + { + FromPhysicalAddress = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + ToPhysicalAddress = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + LastModified = table.Column(type: "datetime2", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_MessageRedirects", x => x.FromPhysicalAddress); + }); + + migrationBuilder.CreateTable( + name: "RetryBatches", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Status = table.Column(type: "int", nullable: false), + RetrySessionId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + RequestId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + RetryType = table.Column(type: "int", nullable: false), + InitialBatchSize = table.Column(type: "int", nullable: false), + StartTime = table.Column(type: "datetime2", nullable: false), + Last = table.Column(type: "datetime2", nullable: true), + StagingId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Context = table.Column(type: "nvarchar(max)", nullable: true), + Originator = table.Column(type: "nvarchar(max)", nullable: true), + Classifier = table.Column(type: "nvarchar(max)", nullable: true), + InitiatedById = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + InitiatedByName = table.Column(type: "nvarchar(max)", nullable: true), + OperationId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_RetryBatches", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "RetryBatchNowForwarding", + columns: table => new + { + Id = table.Column(type: "int", nullable: false), + RetryBatchId = table.Column(type: "uniqueidentifier", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_RetryBatchNowForwarding", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Settings", + columns: table => new + { + Key = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false), + Value = table.Column(type: "nvarchar(max)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Settings", x => x.Key); + }); + + migrationBuilder.CreateTable( + name: "Subscriptions", + columns: table => new + { + MessageType = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + TransportAddress = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + Endpoint = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Subscriptions", x => new { x.MessageType, x.TransportAddress }); + }); + + migrationBuilder.CreateTable( + name: "UnacknowledgedRetryOperations", + columns: table => new + { + RequestId = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), + RetryType = table.Column(type: "int", nullable: false), + StartTime = table.Column(type: "datetime2", nullable: false), + CompletionTime = table.Column(type: "datetime2", nullable: false), + Last = table.Column(type: "datetime2", nullable: false), + Originator = table.Column(type: "nvarchar(max)", nullable: true), + Classifier = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true), + Failed = table.Column(type: "bit", nullable: false), + NumberOfMessagesProcessed = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_UnacknowledgedRetryOperations", x => new { x.RequestId, x.RetryType }); + }); + + migrationBuilder.CreateTable( + name: "FailedMessageGroups", + columns: table => new + { + FailedMessageUniqueId = table.Column(type: "uniqueidentifier", nullable: false), + GroupId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Title = table.Column(type: "nvarchar(max)", nullable: false), + Type = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_FailedMessageGroups", x => new { x.FailedMessageUniqueId, x.GroupId }); + table.ForeignKey( + name: "FK_FailedMessageGroups_FailedMessages_FailedMessageUniqueId", + column: x => x.FailedMessageUniqueId, + principalTable: "FailedMessages", + principalColumn: "UniqueMessageId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "LicensingEndpointThroughput", + columns: table => new + { + NormalizedName = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: false), + ThroughputSource = table.Column(type: "int", nullable: false), + DateUtc = table.Column(type: "date", nullable: false), + MessageCount = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_LicensingEndpointThroughput", x => new { x.NormalizedName, x.ThroughputSource, x.DateUtc }); + table.ForeignKey( + name: "FK_LicensingEndpointThroughput_LicensingEndpoints_NormalizedName_ThroughputSource", + columns: x => new { x.NormalizedName, x.ThroughputSource }, + principalTable: "LicensingEndpoints", + principalColumns: new[] { "NormalizedName", "ThroughputSource" }, + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_ArchiveOperations_Started", + table: "ArchiveOperations", + column: "Started"); + + migrationBuilder.CreateIndex( + name: "IX_CustomChecks_ReportedAt", + table: "CustomChecks", + column: "ReportedAt"); + + migrationBuilder.CreateIndex( + name: "IX_CustomChecks_Status_ReportedAt", + table: "CustomChecks", + columns: new[] { "Status", "ReportedAt" }); + + migrationBuilder.CreateIndex( + name: "IX_EventLogItems_RaisedAt_Id", + table: "EventLogItems", + columns: new[] { "RaisedAt", "Id" }, + descending: new bool[0]); + + migrationBuilder.CreateIndex( + name: "IX_FailedErrorImports_FailedAt", + table: "FailedErrorImports", + column: "FailedAt"); + + migrationBuilder.CreateIndex( + name: "IX_FailedMessageEdits_EditId", + table: "FailedMessageEdits", + column: "EditId"); + + migrationBuilder.CreateIndex( + name: "IX_FailedMessageGroups_GroupId", + table: "FailedMessageGroups", + column: "GroupId"); + + migrationBuilder.CreateIndex( + name: "IX_FailedMessageGroups_Type_GroupId", + table: "FailedMessageGroups", + columns: new[] { "Type", "GroupId" }); + + migrationBuilder.CreateIndex( + name: "IX_FailedMessageRetries_RetryBatchId", + table: "FailedMessageRetries", + column: "RetryBatchId"); + + migrationBuilder.CreateIndex( + name: "IX_FailedMessages_ConversationId", + table: "FailedMessages", + column: "ConversationId"); + + migrationBuilder.CreateIndex( + name: "IX_FailedMessages_FailingEndpointAddress", + table: "FailedMessages", + column: "FailingEndpointAddress"); + + migrationBuilder.CreateIndex( + name: "IX_FailedMessages_ReceivingEndpointName", + table: "FailedMessages", + column: "ReceivingEndpointName"); + + migrationBuilder.CreateIndex( + name: "IX_FailedMessages_Status_LastModified", + table: "FailedMessages", + columns: new[] { "Status", "LastModified" }); + + migrationBuilder.CreateIndex( + name: "IX_FailedMessages_StatusChangedAt", + table: "FailedMessages", + column: "StatusChangedAt", + filter: "[Status] IN (2, 4)"); + + migrationBuilder.CreateIndex( + name: "IX_FailedMessages_TimeSent", + table: "FailedMessages", + column: "TimeSent"); + + migrationBuilder.CreateIndex( + name: "IX_HistoricRetryOperations_CompletionTime_Id", + table: "HistoricRetryOperations", + columns: new[] { "CompletionTime", "Id" }, + descending: new bool[0]); + + migrationBuilder.CreateIndex( + name: "IX_LicensingEndpoints_NormalizedSanitizedName", + table: "LicensingEndpoints", + column: "NormalizedSanitizedName"); + + migrationBuilder.CreateIndex( + name: "IX_LicensingEndpointThroughput_DateUtc", + table: "LicensingEndpointThroughput", + column: "DateUtc"); + + migrationBuilder.CreateIndex( + name: "IX_RetryBatches_Status_RetrySessionId", + table: "RetryBatches", + columns: new[] { "Status", "RetrySessionId" }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "ArchiveOperations"); + + migrationBuilder.DropTable( + name: "CustomChecks"); + + migrationBuilder.DropTable( + name: "EndpointSettings"); + + migrationBuilder.DropTable( + name: "EventLogItems"); + + migrationBuilder.DropTable( + name: "ExternalIntegrationDispatchRequests"); + + migrationBuilder.DropTable( + name: "FailedErrorImports"); + + migrationBuilder.DropTable( + name: "FailedMessageEdits"); + + migrationBuilder.DropTable( + name: "FailedMessageGroups"); + + migrationBuilder.DropTable( + name: "FailedMessageRetries"); + + migrationBuilder.DropTable( + name: "GroupComments"); + + migrationBuilder.DropTable( + name: "HistoricRetryOperations"); + + migrationBuilder.DropTable( + name: "KnownEndpoints"); + + migrationBuilder.DropTable( + name: "LicensingEndpointThroughput"); + + migrationBuilder.DropTable( + name: "MessageRedirects"); + + migrationBuilder.DropTable( + name: "RetryBatches"); + + migrationBuilder.DropTable( + name: "RetryBatchNowForwarding"); + + migrationBuilder.DropTable( + name: "Settings"); + + migrationBuilder.DropTable( + name: "Subscriptions"); + + migrationBuilder.DropTable( + name: "UnacknowledgedRetryOperations"); + + migrationBuilder.DropTable( + name: "FailedMessages"); + + migrationBuilder.DropTable( + name: "LicensingEndpoints"); + } + } +} diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260812000000_MakeFailingEndpointAddressNonNull.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221643_AddFullTextSearch.Designer.cs similarity index 96% rename from src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260812000000_MakeFailingEndpointAddressNonNull.Designer.cs rename to src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221643_AddFullTextSearch.Designer.cs index 2d58fb6009..1cccfcff2c 100644 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260812000000_MakeFailingEndpointAddressNonNull.Designer.cs +++ b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221643_AddFullTextSearch.Designer.cs @@ -12,15 +12,15 @@ namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations { [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260812000000_MakeFailingEndpointAddressNonNull")] - partial class MakeFailingEndpointAddressNonNull + [Migration("20260901221643_AddFullTextSearch")] + partial class AddFullTextSearch { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") + .HasAnnotation("ProductVersion", "10.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); @@ -171,6 +171,28 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("EventLogItems", (string)null); }); + modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.ExternalIntegrationDispatchRequestEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DispatchContextJson") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DispatchContextTypeName") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("ExternalIntegrationDispatchRequests", (string)null); + }); + modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => { b.Property("UniqueMessageId") diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260722061323_AddFullTextSearch.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221643_AddFullTextSearch.cs similarity index 100% rename from src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260722061323_AddFullTextSearch.cs rename to src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221643_AddFullTextSearch.cs diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/SqlServerServiceControlDbContextModelSnapshot.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/SqlServerServiceControlDbContextModelSnapshot.cs index 533575bacc..e335423b2b 100644 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/SqlServerServiceControlDbContextModelSnapshot.cs +++ b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/SqlServerServiceControlDbContextModelSnapshot.cs @@ -17,7 +17,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "10.0.10") + .HasAnnotation("ProductVersion", "10.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); From 87282bb455fde3c725430f65a183ee825a325501 Mon Sep 17 00:00:00 2001 From: John Simons Date: Wed, 2 Sep 2026 14:16:08 +1000 Subject: [PATCH 2/2] Regenerate EF Core migrations with snake_case table names for PostgreSQL Removes the explicit `ToTable("EventLogItems")` and `ToTable("ExternalIntegrationDispatchRequests")` calls from the shared entity configurations, allowing each provider's naming convention to take effect. PostgreSQL migrations now use snake_case table names (`event_log_items`, `external_integration_dispatch_requests`) while SQL Server retains PascalCase. Migration timestamps are updated to reflect the regeneration. --- ....Designer.cs => 20260902040418_Initial.Designer.cs} | 6 +++--- ...0901221615_Initial.cs => 20260902040418_Initial.cs} | 10 +++++----- ...cs => 20260902040422_AddFullTextSearch.Designer.cs} | 6 +++--- ...xtSearch.cs => 20260902040422_AddFullTextSearch.cs} | 0 .../PostgreSqlServiceControlDbContextModelSnapshot.cs | 4 ++-- ....Designer.cs => 20260902040428_Initial.Designer.cs} | 6 +++--- ...0901221640_Initial.cs => 20260902040428_Initial.cs} | 0 ...cs => 20260902040432_AddFullTextSearch.Designer.cs} | 6 +++--- ...xtSearch.cs => 20260902040432_AddFullTextSearch.cs} | 0 .../SqlServerServiceControlDbContextModelSnapshot.cs | 4 ++-- .../EntityConfigurations/EventLogItemConfiguration.cs | 1 - .../ExternalIntegrationDispatchRequestConfiguration.cs | 1 - 12 files changed, 21 insertions(+), 23 deletions(-) rename src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/{20260901221615_Initial.Designer.cs => 20260902040418_Initial.Designer.cs} (99%) rename src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/{20260901221615_Initial.cs => 20260902040418_Initial.cs} (99%) rename src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/{20260901221623_AddFullTextSearch.Designer.cs => 20260902040422_AddFullTextSearch.Designer.cs} (99%) rename src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/{20260901221623_AddFullTextSearch.cs => 20260902040422_AddFullTextSearch.cs} (100%) rename src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/{20260901221640_Initial.Designer.cs => 20260902040428_Initial.Designer.cs} (99%) rename src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/{20260901221640_Initial.cs => 20260902040428_Initial.cs} (100%) rename src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/{20260901221643_AddFullTextSearch.Designer.cs => 20260902040432_AddFullTextSearch.Designer.cs} (99%) rename src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/{20260901221643_AddFullTextSearch.cs => 20260902040432_AddFullTextSearch.cs} (100%) diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221615_Initial.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260902040418_Initial.Designer.cs similarity index 99% rename from src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221615_Initial.Designer.cs rename to src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260902040418_Initial.Designer.cs index 7ce35fa9fd..3c28363759 100644 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221615_Initial.Designer.cs +++ b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260902040418_Initial.Designer.cs @@ -13,7 +13,7 @@ namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations { [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260901221615_Initial")] + [Migration("20260902040418_Initial")] partial class Initial { /// @@ -207,7 +207,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .IsDescending() .HasDatabaseName("ix_event_log_items_raised_at_id"); - b.ToTable("EventLogItems", (string)null); + b.ToTable("event_log_items", (string)null); }); modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.ExternalIntegrationDispatchRequestEntity", b => @@ -233,7 +233,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id") .HasName("pk_external_integration_dispatch_requests"); - b.ToTable("ExternalIntegrationDispatchRequests", (string)null); + b.ToTable("external_integration_dispatch_requests", (string)null); }); modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221615_Initial.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260902040418_Initial.cs similarity index 99% rename from src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221615_Initial.cs rename to src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260902040418_Initial.cs index bcd596230d..7befc46521 100644 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221615_Initial.cs +++ b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260902040418_Initial.cs @@ -67,7 +67,7 @@ protected override void Up(MigrationBuilder migrationBuilder) }); migrationBuilder.CreateTable( - name: "EventLogItems", + name: "event_log_items", columns: table => new { id = table.Column(type: "bigint", nullable: false) @@ -85,7 +85,7 @@ protected override void Up(MigrationBuilder migrationBuilder) }); migrationBuilder.CreateTable( - name: "ExternalIntegrationDispatchRequests", + name: "external_integration_dispatch_requests", columns: table => new { id = table.Column(type: "bigint", nullable: false) @@ -392,7 +392,7 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateIndex( name: "ix_event_log_items_raised_at_id", - table: "EventLogItems", + table: "event_log_items", columns: new[] { "raised_at", "id" }, descending: new bool[0]); @@ -487,10 +487,10 @@ protected override void Down(MigrationBuilder migrationBuilder) name: "endpoint_settings"); migrationBuilder.DropTable( - name: "EventLogItems"); + name: "event_log_items"); migrationBuilder.DropTable( - name: "ExternalIntegrationDispatchRequests"); + name: "external_integration_dispatch_requests"); migrationBuilder.DropTable( name: "failed_error_imports"); diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221623_AddFullTextSearch.Designer.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260902040422_AddFullTextSearch.Designer.cs similarity index 99% rename from src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221623_AddFullTextSearch.Designer.cs rename to src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260902040422_AddFullTextSearch.Designer.cs index e6cf93ab97..50da88449e 100644 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221623_AddFullTextSearch.Designer.cs +++ b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260902040422_AddFullTextSearch.Designer.cs @@ -13,7 +13,7 @@ namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations { [DbContext(typeof(PostgreSqlServiceControlDbContext))] - [Migration("20260901221623_AddFullTextSearch")] + [Migration("20260902040422_AddFullTextSearch")] partial class AddFullTextSearch { /// @@ -207,7 +207,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .IsDescending() .HasDatabaseName("ix_event_log_items_raised_at_id"); - b.ToTable("EventLogItems", (string)null); + b.ToTable("event_log_items", (string)null); }); modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.ExternalIntegrationDispatchRequestEntity", b => @@ -233,7 +233,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id") .HasName("pk_external_integration_dispatch_requests"); - b.ToTable("ExternalIntegrationDispatchRequests", (string)null); + b.ToTable("external_integration_dispatch_requests", (string)null); }); modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221623_AddFullTextSearch.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260902040422_AddFullTextSearch.cs similarity index 100% rename from src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260901221623_AddFullTextSearch.cs rename to src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/20260902040422_AddFullTextSearch.cs diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/PostgreSqlServiceControlDbContextModelSnapshot.cs b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/PostgreSqlServiceControlDbContextModelSnapshot.cs index 89d3c4c112..af482619d5 100644 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/PostgreSqlServiceControlDbContextModelSnapshot.cs +++ b/src/ServiceControl.Persistence.EFCore.PostgreSql/Migrations/PostgreSqlServiceControlDbContextModelSnapshot.cs @@ -204,7 +204,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsDescending() .HasDatabaseName("ix_event_log_items_raised_at_id"); - b.ToTable("EventLogItems", (string)null); + b.ToTable("event_log_items", (string)null); }); modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.ExternalIntegrationDispatchRequestEntity", b => @@ -230,7 +230,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id") .HasName("pk_external_integration_dispatch_requests"); - b.ToTable("ExternalIntegrationDispatchRequests", (string)null); + b.ToTable("external_integration_dispatch_requests", (string)null); }); modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221640_Initial.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260902040428_Initial.Designer.cs similarity index 99% rename from src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221640_Initial.Designer.cs rename to src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260902040428_Initial.Designer.cs index c4e631848d..e1ce6ca70c 100644 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221640_Initial.Designer.cs +++ b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260902040428_Initial.Designer.cs @@ -12,7 +12,7 @@ namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations { [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260901221640_Initial")] + [Migration("20260902040428_Initial")] partial class Initial { /// @@ -168,7 +168,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("RaisedAt", "Id") .IsDescending(); - b.ToTable("EventLogItems", (string)null); + b.ToTable("EventLogItems"); }); modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.ExternalIntegrationDispatchRequestEntity", b => @@ -190,7 +190,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ExternalIntegrationDispatchRequests", (string)null); + b.ToTable("ExternalIntegrationDispatchRequests"); }); modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221640_Initial.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260902040428_Initial.cs similarity index 100% rename from src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221640_Initial.cs rename to src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260902040428_Initial.cs diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221643_AddFullTextSearch.Designer.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260902040432_AddFullTextSearch.Designer.cs similarity index 99% rename from src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221643_AddFullTextSearch.Designer.cs rename to src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260902040432_AddFullTextSearch.Designer.cs index 1cccfcff2c..ef74722179 100644 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221643_AddFullTextSearch.Designer.cs +++ b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260902040432_AddFullTextSearch.Designer.cs @@ -12,7 +12,7 @@ namespace ServiceControl.Persistence.EFCore.SqlServer.Migrations { [DbContext(typeof(SqlServerServiceControlDbContext))] - [Migration("20260901221643_AddFullTextSearch")] + [Migration("20260902040432_AddFullTextSearch")] partial class AddFullTextSearch { /// @@ -168,7 +168,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("RaisedAt", "Id") .IsDescending(); - b.ToTable("EventLogItems", (string)null); + b.ToTable("EventLogItems"); }); modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.ExternalIntegrationDispatchRequestEntity", b => @@ -190,7 +190,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ExternalIntegrationDispatchRequests", (string)null); + b.ToTable("ExternalIntegrationDispatchRequests"); }); modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221643_AddFullTextSearch.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260902040432_AddFullTextSearch.cs similarity index 100% rename from src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260901221643_AddFullTextSearch.cs rename to src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/20260902040432_AddFullTextSearch.cs diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/SqlServerServiceControlDbContextModelSnapshot.cs b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/SqlServerServiceControlDbContextModelSnapshot.cs index e335423b2b..27868fadac 100644 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/SqlServerServiceControlDbContextModelSnapshot.cs +++ b/src/ServiceControl.Persistence.EFCore.SqlServer/Migrations/SqlServerServiceControlDbContextModelSnapshot.cs @@ -165,7 +165,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("RaisedAt", "Id") .IsDescending(); - b.ToTable("EventLogItems", (string)null); + b.ToTable("EventLogItems"); }); modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.ExternalIntegrationDispatchRequestEntity", b => @@ -187,7 +187,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("ExternalIntegrationDispatchRequests", (string)null); + b.ToTable("ExternalIntegrationDispatchRequests"); }); modelBuilder.Entity("ServiceControl.Persistence.EFCore.Entities.FailedErrorImportEntity", b => diff --git a/src/ServiceControl.Persistence.EFCore/EntityConfigurations/EventLogItemConfiguration.cs b/src/ServiceControl.Persistence.EFCore/EntityConfigurations/EventLogItemConfiguration.cs index 5c8ff82376..760ad2a815 100644 --- a/src/ServiceControl.Persistence.EFCore/EntityConfigurations/EventLogItemConfiguration.cs +++ b/src/ServiceControl.Persistence.EFCore/EntityConfigurations/EventLogItemConfiguration.cs @@ -8,7 +8,6 @@ class EventLogItemConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { - builder.ToTable("EventLogItems"); builder.HasKey(e => e.Id); builder.Property(e => e.Id).ValueGeneratedOnAdd(); builder.Property(e => e.Description).IsRequired(); diff --git a/src/ServiceControl.Persistence.EFCore/EntityConfigurations/ExternalIntegrationDispatchRequestConfiguration.cs b/src/ServiceControl.Persistence.EFCore/EntityConfigurations/ExternalIntegrationDispatchRequestConfiguration.cs index acce35b9bf..6553dc03c4 100644 --- a/src/ServiceControl.Persistence.EFCore/EntityConfigurations/ExternalIntegrationDispatchRequestConfiguration.cs +++ b/src/ServiceControl.Persistence.EFCore/EntityConfigurations/ExternalIntegrationDispatchRequestConfiguration.cs @@ -8,7 +8,6 @@ class ExternalIntegrationDispatchRequestConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { - builder.ToTable("ExternalIntegrationDispatchRequests"); builder.HasKey(e => e.Id); builder.Property(e => e.Id).ValueGeneratedOnAdd(); builder.Property(e => e.DispatchContextTypeName).IsRequired().HasMaxLength(ColumnLengths.ShortTextLength);