Update BookId to add the reference logic.

This commit is contained in:
2025-03-20 16:49:17 +02:00
parent ddd300625c
commit 709905a8e1
3 changed files with 160 additions and 1 deletions
@@ -9,16 +9,25 @@ defmodule DecentralisedBookIndex.Metadata.BookId do
postgres do
table "book_ids"
repo DecentralisedBookIndex.Repo
references do
reference :book, index?: true, on_delete: :delete
end
end
actions do
defaults [:read, :update, :destroy]
defaults [:read, :destroy]
create :create do
primary? true
accept [:type, :bid, :order]
end
update :update do
primary? true
accept [:type, :bid, :order]
end
read :by_id do
argument :id, :uuid, allow_nil?: false
get? true