defmodule Edgehog.Containers.Image do @moduledoc false use Edgehog.MultitenantResource, domain: Edgehog.Containers, extensions: [AshGraphql.Resource] alias Edgehog.Containers.ImageCredentials graphql do type :image paginate_relationship_with devices: :relay end actions do defaults [:read, :destroy, create: [:reference, :image_credentials_id]] attributes do uuid_primary_key :id attribute :reference, :string do allow_nil? false public? true end timestamps() end relationships do belongs_to :credentials, ImageCredentials do source_attribute :image_credentials_id attribute_type :uuid public? true end many_to_many :devices, Edgehog.Devices.Device do through Edgehog.Containers.Image.Deployment join_relationship :image_deployments public? true end end identities do identity :reference, [:reference] end postgres do table "images" end end