From d679f48755ae591e8a841146ae89d09b90167a9d Mon Sep 17 00:00:00 2001 From: Kayla Firestack Date: Fri, 6 Sep 2024 12:09:02 -0400 Subject: [PATCH] feat(ex/notifications): add corrisponding detour notifications to notfications table --- lib/notifications/db/notification.ex | 1 + ...40909200808_create_detour_notifications_reference.exs | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 priv/repo/migrations/20240909200808_create_detour_notifications_reference.exs diff --git a/lib/notifications/db/notification.ex b/lib/notifications/db/notification.ex index 4b0f6e01e..24c03f7cb 100644 --- a/lib/notifications/db/notification.ex +++ b/lib/notifications/db/notification.ex @@ -19,6 +19,7 @@ defmodule Notifications.Db.Notification do belongs_to(:block_waiver, DbBlockWaiver) belongs_to(:bridge_movement, DbBridgeMovement) + belongs_to(:detour, Notifications.Db.Detour) end def block_waiver_changeset(notification, attrs \\ %{}) do diff --git a/priv/repo/migrations/20240909200808_create_detour_notifications_reference.exs b/priv/repo/migrations/20240909200808_create_detour_notifications_reference.exs new file mode 100644 index 000000000..c8f15f954 --- /dev/null +++ b/priv/repo/migrations/20240909200808_create_detour_notifications_reference.exs @@ -0,0 +1,9 @@ +defmodule Skate.Repo.Migrations.CreateDetourNotificationsReference do + use Ecto.Migration + + def change do + alter table(:notifications) do + add(:detour_id, references(:detour_notifications)) + end + end +end