defmodule Example.Blog.Post do
use Ash.Resource,
data_layer: AshPostgres.DataLayer
attributes do
uuid_primary_key :id
attribute :content, :string do
allow_nil? false
end
end
postgres do
table "blog_posts"
repo Example.Repo
end
actions do
defaults [:create, :read]
end
end
defmodule Example.Blog.Post do
use Ash.Resource,
data_layer: AshPostgres.DataLayer
attributes do
uuid_primary_key :id
attribute :content, :string do
allow_nil? false
end
end
postgres do
table "blog_posts"
repo Example.Repo
end
actions do
defaults [:create, :read]
end
end