-
Notifications
You must be signed in to change notification settings - Fork 520
Expand file tree
/
Copy path20250927073029_AddMissingForeignKeys.cs
More file actions
50 lines (43 loc) · 1.66 KB
/
20250927073029_AddMissingForeignKeys.cs
File metadata and controls
50 lines (43 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#nullable disable
namespace EvolutionaryArchitecture.Fitnet.Passes.DataAccess.Database.Migrations;
using System.Diagnostics.CodeAnalysis;
using Microsoft.EntityFrameworkCore.Migrations;
/// <inheritdoc />
[ExcludeFromCodeCoverage]
public partial class AddMissingForeignKeys : Migration
{
private static readonly string[] columns = ["InboxMessageId", "InboxConsumerId"];
private static readonly string[] principalColumns = ["MessageId", "ConsumerId"];
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddForeignKey(
name: "FK_OutboxMessage_InboxState_InboxMessageId_InboxConsumerId",
schema: "Passes",
table: "OutboxMessage",
columns: columns,
principalSchema: "Passes",
principalTable: "InboxState",
principalColumns: principalColumns);
migrationBuilder.AddForeignKey(
name: "FK_OutboxMessage_OutboxState_OutboxId",
schema: "Passes",
table: "OutboxMessage",
column: "OutboxId",
principalSchema: "Passes",
principalTable: "OutboxState",
principalColumn: "OutboxId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_OutboxMessage_InboxState_InboxMessageId_InboxConsumerId",
schema: "Passes",
table: "OutboxMessage");
migrationBuilder.DropForeignKey(
name: "FK_OutboxMessage_OutboxState_OutboxId",
schema: "Passes",
table: "OutboxMessage");
}
}