mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 21:43:12 +12:00
25 lines
457 B
Elixir
25 lines
457 B
Elixir
|
defmodule AshPostgres.Test.Organization do
|
||
|
@moduledoc false
|
||
|
use Ash.Resource,
|
||
|
data_layer: AshPostgres.DataLayer
|
||
|
|
||
|
postgres do
|
||
|
table("orgs")
|
||
|
repo(AshPostgres.TestRepo)
|
||
|
end
|
||
|
|
||
|
actions do
|
||
|
defaults([:create, :read, :update, :destroy])
|
||
|
end
|
||
|
|
||
|
attributes do
|
||
|
uuid_primary_key(:id)
|
||
|
attribute(:name, :string)
|
||
|
end
|
||
|
|
||
|
relationships do
|
||
|
has_many(:users, AshPostgres.Test.User)
|
||
|
has_many(:posts, AshPostgres.Test.Post)
|
||
|
end
|
||
|
end
|