Skip to content

Commit 83e86da

Browse files
committed
chore: remove unused relations
removes the old manual `has_many` relationship in favor of a proper `many_to_many` for network <-> container and volume <-> container. These were not checked with old ash versions, but cause now warnings during the compilation. Signed-off-by: Luca Zaninotto <luca.zaninotto@secomind.com>
1 parent c8a8c46 commit 83e86da

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

backend/lib/edgehog/containers/network/network.ex

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ defmodule Edgehog.Containers.Network do
9797
join_relationship :network_deployments
9898
public? true
9999
end
100-
101-
has_many :container_networks, ContainerNetwork
102100
end
103101

104102
calculations do
@@ -118,9 +116,5 @@ defmodule Edgehog.Containers.Network do
118116
postgres do
119117
table "networks"
120118
repo Edgehog.Repo
121-
122-
references do
123-
reference :container_networks, on_delete: :restrict, match_with: [tenant_id: :tenant_id]
124-
end
125119
end
126120
end

backend/lib/edgehog/containers/volume/volume.ex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ defmodule Edgehog.Containers.Volume do
8686
public? true
8787
end
8888

89-
has_many :container_volumes, Edgehog.Containers.ContainerVolume
89+
many_to_many :containers, Edgehog.Containers.Container do
90+
through Edgehog.Containers.ContainerVolume
91+
join_relationship :container_volumes
92+
public? true
93+
end
9094
end
9195

9296
calculations do
@@ -106,9 +110,5 @@ defmodule Edgehog.Containers.Volume do
106110
postgres do
107111
table "volumes"
108112
repo Edgehog.Repo
109-
110-
references do
111-
reference :container_volumes, on_delete: :restrict, match_with: [tenant_id: :tenant_id]
112-
end
113113
end
114114
end

0 commit comments

Comments
 (0)