Update BookId to add the reference logic.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user