Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
rbino committed Sep 5, 2024
1 parent f29441f commit ba3b257
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 18 deletions.
5 changes: 5 additions & 0 deletions backend/lib/edgehog/base_images/base_image/base_image.ex
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ defmodule Edgehog.BaseImages.BaseImage do
attribute_public? false
allow_nil? false
end

# This is needed to ensure foreign key references are applied when deleting
# base images so we can render a nice looking error instead of crashing, see
# https://github.com/ash-project/ash_postgres/blob/0ccb35a713b9097c4aac6fde996dbb4d1c00cccb/lib/data_layer.ex#L2370
has_many :update_campaigns, Edgehog.UpdateCampaigns.UpdateCampaign
end

calculations do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ defmodule Edgehog.UpdateCampaigns.UpdateChannel do
description "The device groups targeted by the update channel."
public? true
end

# This is needed to ensure foreign key references are applied when deleting
# base images so we can render a nice looking error instead of crashing, see
# https://github.com/ash-project/ash_postgres/blob/0ccb35a713b9097c4aac6fde996dbb4d1c00cccb/lib/data_layer.ex#L2370
has_many :update_campaigns, Edgehog.UpdateCampaigns.UpdateCampaign
end

calculations do
Expand Down
Loading

0 comments on commit ba3b257

Please sign in to comment.