ash_postgres/test/support/resources/organization.ex
Tommaso Patrizi 96165a58ea
tests: added test for bulk upsert (#148)
Co-authored-by: Tommaso Patrizi <tommasop@gmail.com>
2023-05-26 23:58:04 -04:00

25 lines
524 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, writable?: true)
attribute(:name, :string)
end
relationships do
has_many(:users, AshPostgres.Test.User)
has_many(:posts, AshPostgres.Test.Post)
has_many(:managers, AshPostgres.Test.Manager)
end
end