mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 13:33:50 +12:00
31 lines
636 B
Elixir
31 lines
636 B
Elixir
defmodule AshPostgres.MultitenancyTest.PostLink do
|
|
@moduledoc false
|
|
use Ash.Resource,
|
|
domain: AshPostgres.MultitenancyTest.Domain,
|
|
data_layer: AshPostgres.DataLayer
|
|
|
|
postgres do
|
|
table "friend_links"
|
|
repo AshPostgres.TestRepo
|
|
end
|
|
|
|
multitenancy do
|
|
strategy(:context)
|
|
end
|
|
|
|
actions do
|
|
defaults([:read, :destroy, create: :*, update: :*])
|
|
end
|
|
|
|
relationships do
|
|
belongs_to(:source, AshPostgres.MultitenancyTest.Post,
|
|
primary_key?: true,
|
|
allow_nil?: false
|
|
)
|
|
|
|
belongs_to(:dest, AshPostgres.MultitenancyTest.Post,
|
|
primary_key?: true,
|
|
allow_nil?: false
|
|
)
|
|
end
|
|
end
|