Add migrations to require Book's Publisher and AuthorRole's Author.

This commit is contained in:
2025-05-07 19:05:44 +03:00
parent 59cc87cd97
commit 51c86be131
3 changed files with 412 additions and 0 deletions
@@ -0,0 +1,29 @@
defmodule DecentralisedBookIndex.Repo.Migrations.UpdateToRequireAuthorForAuthorRoleAndPublisherForBook do
@moduledoc """
Updates resources based on their most recent snapshots.
This file was autogenerated with `mix ash_postgres.generate_migrations`
"""
use Ecto.Migration
def up do
alter table(:books) do
modify :publisher_id, :uuid, null: false
end
alter table(:author_role) do
modify :author_id, :uuid, null: false
end
end
def down do
alter table(:author_role) do
modify :author_id, :uuid, null: true
end
alter table(:books) do
modify :publisher_id, :uuid, null: true
end
end
end