mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 21:43:12 +12:00
28 lines
510 B
Elixir
28 lines
510 B
Elixir
defmodule AshPostgres.Test.PostFollower do
|
|
@moduledoc false
|
|
use Ash.Resource,
|
|
data_layer: AshPostgres.DataLayer
|
|
|
|
postgres do
|
|
table "post_followers"
|
|
repo AshPostgres.TestRepo
|
|
end
|
|
|
|
actions do
|
|
defaults([:create, :read, :update, :destroy])
|
|
end
|
|
|
|
attributes do
|
|
uuid_primary_key(:id)
|
|
end
|
|
|
|
relationships do
|
|
belongs_to :post, AshPostgres.Test.Post do
|
|
allow_nil?(false)
|
|
end
|
|
|
|
belongs_to :follower, AshPostgres.Test.User do
|
|
allow_nil?(false)
|
|
end
|
|
end
|
|
end
|