defmodule One.Exam.QuestionParagraph do
use Ash.Resource,
data_layer: AshPostgres.DataLayer
postgres do
table "question_paragraphs"
repo One.Repo
end
actions do
defaults [:create, :read, :update, :destroy]
end
attributes do
uuid_primary_key :id
attribute :ordinal, :integer
attribute :text, :string
attribute :image, :string
end
relationships do
belongs_to :question, One.Exam.Question
end
identities do
identity :order, [:ordinal, :question]
end
end
defmodule One.Exam.QuestionParagraph do
use Ash.Resource,
data_layer: AshPostgres.DataLayer
postgres do
table "question_paragraphs"
repo One.Repo
end
actions do
defaults [:create, :read, :update, :destroy]
end
attributes do
uuid_primary_key :id
attribute :ordinal, :integer
attribute :text, :string
attribute :image, :string
end
relationships do
belongs_to :question, One.Exam.Question
end
identities do
identity :order, [:ordinal, :question]
end
end