fix: add missing FK migration for EmailChannelUsage -> EmailChannel

- EF model had a pending HasOne/WithMany relationship not in migrations
- Adds FK_email_channel_usage_email_channels_provider_id with cascade delete

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Anatolii Grynchuk
2026-05-02 18:43:20 +03:00
parent c5528b253d
commit d71c3513a5
3 changed files with 269 additions and 0 deletions
@@ -0,0 +1,30 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace HrynCo.NotificationService.DAL.EF.Migrations
{
/// <inheritdoc />
public partial class PendingChanges : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddForeignKey(
name: "FK_email_channel_usage_email_channels_provider_id",
table: "email_channel_usage",
column: "provider_id",
principalTable: "email_channels",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_email_channel_usage_email_channels_provider_id",
table: "email_channel_usage");
}
}
}