| | | 1 | | using Microsoft.EntityFrameworkCore.Infrastructure; |
| | | 2 | | using Microsoft.EntityFrameworkCore.Migrations; |
| | | 3 | | |
| | | 4 | | #nullable disable |
| | | 5 | | |
| | | 6 | | namespace ProjectTemplate.Infrastructure.Data.Migrations; |
| | | 7 | | |
| | | 8 | | /// <inheritdoc /> |
| | | 9 | | [DbContext(typeof(ApplicationDbContext))] |
| | | 10 | | [Migration("20260719170000_AddApplicationAuditReconciliation")] |
| | | 11 | | public partial class AddApplicationAuditReconciliation : Migration |
| | | 12 | | { |
| | | 13 | | /// <inheritdoc /> |
| | | 14 | | protected override void Up(MigrationBuilder migrationBuilder) |
| | | 15 | | { |
| | 2 | 16 | | migrationBuilder.CreateTable( |
| | 2 | 17 | | name: "ApplicationAuditReconciliationFindings", |
| | 2 | 18 | | columns: table => new |
| | 2 | 19 | | { |
| | 2 | 20 | | Id = table.Column<Guid>(type: "TEXT", nullable: false), |
| | 2 | 21 | | SchemaVersion = table.Column<string>(type: "TEXT", maxLength: 32, nullable: false), |
| | 2 | 22 | | FindingKey = table.Column<string>(type: "TEXT", maxLength: 128, nullable: false), |
| | 2 | 23 | | ReasonCode = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false), |
| | 2 | 24 | | Severity = table.Column<string>(type: "TEXT", maxLength: 32, nullable: false), |
| | 2 | 25 | | MutationBatchId = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false), |
| | 2 | 26 | | Destination = table.Column<string>(type: "TEXT", maxLength: 128, nullable: true), |
| | 2 | 27 | | Guidance = table.Column<string>(type: "TEXT", maxLength: 512, nullable: false), |
| | 2 | 28 | | RemediationStatus = table.Column<string>(type: "TEXT", maxLength: 32, nullable: false), |
| | 2 | 29 | | FirstObservedUtc = table.Column<DateTime>(type: "TEXT", precision: 3, nullable: false), |
| | 2 | 30 | | LastObservedUtc = table.Column<DateTime>(type: "TEXT", precision: 3, nullable: false), |
| | 2 | 31 | | ResolvedUtc = table.Column<DateTime>(type: "TEXT", precision: 3, nullable: true), |
| | 2 | 32 | | ConcurrencyStamp = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false) |
| | 2 | 33 | | }, |
| | 4 | 34 | | constraints: table => table.PrimaryKey("PK_ApplicationAuditReconciliationFindings", x => x.Id)); |
| | | 35 | | |
| | 2 | 36 | | migrationBuilder.CreateTable( |
| | 2 | 37 | | name: "ApplicationAuditReconciliationRemediations", |
| | 2 | 38 | | columns: table => new |
| | 2 | 39 | | { |
| | 2 | 40 | | Id = table.Column<Guid>(type: "TEXT", nullable: false), |
| | 2 | 41 | | FindingId = table.Column<Guid>(type: "TEXT", nullable: false), |
| | 2 | 42 | | MutationBatchId = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false), |
| | 2 | 43 | | ActionCode = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false), |
| | 2 | 44 | | ActorId = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false), |
| | 2 | 45 | | EvidenceReference = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true), |
| | 2 | 46 | | RecordedUtc = table.Column<DateTime>(type: "TEXT", precision: 3, nullable: false), |
| | 2 | 47 | | ConcurrencyStamp = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false) |
| | 2 | 48 | | }, |
| | 4 | 49 | | constraints: table => table.PrimaryKey("PK_ApplicationAuditReconciliationRemediations", x => x.Id)); |
| | | 50 | | |
| | 2 | 51 | | migrationBuilder.CreateIndex( |
| | 2 | 52 | | name: "IX_ApplicationAuditReconciliationFindings_FindingKey", |
| | 2 | 53 | | table: "ApplicationAuditReconciliationFindings", |
| | 2 | 54 | | column: "FindingKey", |
| | 2 | 55 | | unique: true); |
| | | 56 | | |
| | 2 | 57 | | migrationBuilder.CreateIndex( |
| | 2 | 58 | | name: "IX_ApplicationAuditReconciliationFindings_MutationBatchId_ReasonCode", |
| | 2 | 59 | | table: "ApplicationAuditReconciliationFindings", |
| | 2 | 60 | | columns: ["MutationBatchId", "ReasonCode"]); |
| | | 61 | | |
| | 2 | 62 | | migrationBuilder.CreateIndex( |
| | 2 | 63 | | name: "IX_ApplicationAuditReconciliationFindings_RemediationStatus_Severity", |
| | 2 | 64 | | table: "ApplicationAuditReconciliationFindings", |
| | 2 | 65 | | columns: ["RemediationStatus", "Severity"]); |
| | | 66 | | |
| | 2 | 67 | | migrationBuilder.CreateIndex( |
| | 2 | 68 | | name: "IX_ApplicationAuditReconciliationRemediations_FindingId", |
| | 2 | 69 | | table: "ApplicationAuditReconciliationRemediations", |
| | 2 | 70 | | column: "FindingId"); |
| | | 71 | | |
| | 2 | 72 | | migrationBuilder.CreateIndex( |
| | 2 | 73 | | name: "IX_ApplicationAuditReconciliationRemediations_MutationBatchId", |
| | 2 | 74 | | table: "ApplicationAuditReconciliationRemediations", |
| | 2 | 75 | | column: "MutationBatchId"); |
| | 2 | 76 | | } |
| | | 77 | | |
| | | 78 | | /// <inheritdoc /> |
| | | 79 | | protected override void Down(MigrationBuilder migrationBuilder) |
| | | 80 | | { |
| | 2 | 81 | | migrationBuilder.DropTable(name: "ApplicationAuditReconciliationRemediations"); |
| | 2 | 82 | | migrationBuilder.DropTable(name: "ApplicationAuditReconciliationFindings"); |
| | 2 | 83 | | } |
| | | 84 | | } |