diff --git a/lib/decentralised_book_index/metadata/author.ex b/lib/decentralised_book_index/metadata/author.ex index 50e24b5..b037344 100644 --- a/lib/decentralised_book_index/metadata/author.ex +++ b/lib/decentralised_book_index/metadata/author.ex @@ -157,6 +157,8 @@ defmodule DecentralisedBookIndex.Metadata.Author do end relationships do + belongs_to :dbi_server, Metadata.DBIServer + belongs_to :author_alias_registry, Metadata.AuthorAliasRegistry do attribute_writable? true end diff --git a/lib/decentralised_book_index/metadata/author_alias_registry.ex b/lib/decentralised_book_index/metadata/author_alias_registry.ex index 63781c8..cd10dbe 100644 --- a/lib/decentralised_book_index/metadata/author_alias_registry.ex +++ b/lib/decentralised_book_index/metadata/author_alias_registry.ex @@ -4,6 +4,8 @@ defmodule DecentralisedBookIndex.Metadata.AuthorAliasRegistry do domain: DecentralisedBookIndex.Metadata, data_layer: AshPostgres.DataLayer + alias DecentralisedBookIndex.Metadata + postgres do table "author_alias_registries" repo DecentralisedBookIndex.Repo @@ -26,6 +28,8 @@ defmodule DecentralisedBookIndex.Metadata.AuthorAliasRegistry do end relationships do + belongs_to :dbi_server, Metadata.DBIServer + has_many :authors, DecentralisedBookIndex.Metadata.Author end end diff --git a/lib/decentralised_book_index/metadata/author_role.ex b/lib/decentralised_book_index/metadata/author_role.ex index 85a6bd6..6fc8625 100644 --- a/lib/decentralised_book_index/metadata/author_role.ex +++ b/lib/decentralised_book_index/metadata/author_role.ex @@ -44,6 +44,8 @@ defmodule DecentralisedBookIndex.Metadata.AuthorRole do accept [:order, :role] argument :author_id, :uuid + require_atomic? false + change fn changeset, _ -> author_id = changeset.arguments.author_id @@ -75,6 +77,8 @@ defmodule DecentralisedBookIndex.Metadata.AuthorRole do end relationships do + belongs_to :dbi_server, Metadata.DBIServer + belongs_to :book, Metadata.Book do allow_nil? true end diff --git a/lib/decentralised_book_index/metadata/book.ex b/lib/decentralised_book_index/metadata/book.ex index 1528450..646b6c9 100644 --- a/lib/decentralised_book_index/metadata/book.ex +++ b/lib/decentralised_book_index/metadata/book.ex @@ -148,6 +148,8 @@ defmodule DecentralisedBookIndex.Metadata.Book do end relationships do + belongs_to :dbi_server, Metadata.DBIServer + belongs_to :book_editions_registry, Metadata.BookEditionsRegistry belongs_to :publisher, Metadata.Publisher diff --git a/lib/decentralised_book_index/metadata/book_editions_registry.ex b/lib/decentralised_book_index/metadata/book_editions_registry.ex index 67d133e..3111916 100644 --- a/lib/decentralised_book_index/metadata/book_editions_registry.ex +++ b/lib/decentralised_book_index/metadata/book_editions_registry.ex @@ -4,6 +4,8 @@ defmodule DecentralisedBookIndex.Metadata.BookEditionsRegistry do domain: DecentralisedBookIndex.Metadata, data_layer: AshPostgres.DataLayer + alias DecentralisedBookIndex.Metadata + postgres do table "book_editions_registries" repo DecentralisedBookIndex.Repo @@ -26,6 +28,8 @@ defmodule DecentralisedBookIndex.Metadata.BookEditionsRegistry do end relationships do + belongs_to :dbi_server, Metadata.DBIServer + has_many :authors, DecentralisedBookIndex.Metadata.Book end end diff --git a/lib/decentralised_book_index/metadata/book_id.ex b/lib/decentralised_book_index/metadata/book_id.ex index 7ffab58..90e0a1a 100644 --- a/lib/decentralised_book_index/metadata/book_id.ex +++ b/lib/decentralised_book_index/metadata/book_id.ex @@ -57,6 +57,8 @@ defmodule DecentralisedBookIndex.Metadata.BookId do end relationships do + belongs_to :dbi_server, Metadata.DBIServer + belongs_to :book, Metadata.Book do allow_nil? true end diff --git a/lib/decentralised_book_index/metadata/dbi_server.ex b/lib/decentralised_book_index/metadata/dbi_server.ex index c01bddd..652c240 100644 --- a/lib/decentralised_book_index/metadata/dbi_server.ex +++ b/lib/decentralised_book_index/metadata/dbi_server.ex @@ -4,6 +4,8 @@ defmodule DecentralisedBookIndex.Metadata.DBIServer do domain: DecentralisedBookIndex.Metadata, data_layer: AshPostgres.DataLayer + alias DecentralisedBookIndex.Metadata + postgres do table "dbi_servers" repo DecentralisedBookIndex.Repo @@ -38,4 +40,16 @@ defmodule DecentralisedBookIndex.Metadata.DBIServer do timestamps() end + + relationships do + has_many :author, Metadata.Author + has_many :author_alias_registries, Metadata.AuthorAliasRegistry + has_many :author_roles, Metadata.AuthorRole + + has_many :books, Metadata.Book + has_many :bids, Metadata.BookId + has_many :book_editions_registries, Metadata.BookEditionsRegistry + + has_many :publisher, Metadata.Publisher + end end diff --git a/lib/decentralised_book_index/metadata/publisher.ex b/lib/decentralised_book_index/metadata/publisher.ex index 0c2a61d..466cb41 100644 --- a/lib/decentralised_book_index/metadata/publisher.ex +++ b/lib/decentralised_book_index/metadata/publisher.ex @@ -39,6 +39,8 @@ defmodule DecentralisedBookIndex.Metadata.Publisher do end relationships do + belongs_to :dbi_server, Metadata.DBIServer + has_many :books, Metadata.Book end end diff --git a/priv/repo/migrations/20250323094316_add_relationships_to_dbi_server_for_all_resources.exs b/priv/repo/migrations/20250323094316_add_relationships_to_dbi_server_for_all_resources.exs new file mode 100644 index 0000000..bec8177 --- /dev/null +++ b/priv/repo/migrations/20250323094316_add_relationships_to_dbi_server_for_all_resources.exs @@ -0,0 +1,125 @@ +defmodule DecentralisedBookIndex.Repo.Migrations.AddRelationshipToDbiServerForAllResources 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(:publishers) do + add :dbi_server_id, + references(:dbi_servers, + column: :id, + name: "publishers_dbi_server_id_fkey", + type: :uuid, + prefix: "public" + ) + end + + alter table(:books) do + add :dbi_server_id, + references(:dbi_servers, + column: :id, + name: "books_dbi_server_id_fkey", + type: :uuid, + prefix: "public" + ) + end + + alter table(:book_ids) do + add :dbi_server_id, + references(:dbi_servers, + column: :id, + name: "book_ids_dbi_server_id_fkey", + type: :uuid, + prefix: "public" + ) + end + + alter table(:book_editions_registries) do + add :dbi_server_id, + references(:dbi_servers, + column: :id, + name: "book_editions_registries_dbi_server_id_fkey", + type: :uuid, + prefix: "public" + ) + end + + alter table(:authors) do + add :dbi_server_id, + references(:dbi_servers, + column: :id, + name: "authors_dbi_server_id_fkey", + type: :uuid, + prefix: "public" + ) + end + + alter table(:author_role) do + add :dbi_server_id, + references(:dbi_servers, + column: :id, + name: "author_role_dbi_server_id_fkey", + type: :uuid, + prefix: "public" + ) + end + + alter table(:author_alias_registries) do + add :dbi_server_id, + references(:dbi_servers, + column: :id, + name: "author_alias_registries_dbi_server_id_fkey", + type: :uuid, + prefix: "public" + ) + end + end + + def down do + drop constraint(:author_alias_registries, "author_alias_registries_dbi_server_id_fkey") + + alter table(:author_alias_registries) do + remove :dbi_server_id + end + + drop constraint(:author_role, "author_role_dbi_server_id_fkey") + + alter table(:author_role) do + remove :dbi_server_id + end + + drop constraint(:authors, "authors_dbi_server_id_fkey") + + alter table(:authors) do + remove :dbi_server_id + end + + drop constraint(:book_editions_registries, "book_editions_registries_dbi_server_id_fkey") + + alter table(:book_editions_registries) do + remove :dbi_server_id + end + + drop constraint(:book_ids, "book_ids_dbi_server_id_fkey") + + alter table(:book_ids) do + remove :dbi_server_id + end + + drop constraint(:books, "books_dbi_server_id_fkey") + + alter table(:books) do + remove :dbi_server_id + end + + drop constraint(:publishers, "publishers_dbi_server_id_fkey") + + alter table(:publishers) do + remove :dbi_server_id + end + end +end diff --git a/priv/resource_snapshots/repo/author_alias_registries/20250323094317.json b/priv/resource_snapshots/repo/author_alias_registries/20250323094317.json new file mode 100644 index 0000000..b94ab2e --- /dev/null +++ b/priv/resource_snapshots/repo/author_alias_registries/20250323094317.json @@ -0,0 +1,78 @@ +{ + "attributes": [ + { + "allow_nil?": false, + "default": "fragment(\"gen_random_uuid()\")", + "generated?": false, + "primary_key?": true, + "references": null, + "size": null, + "source": "id", + "type": "uuid" + }, + { + "allow_nil?": false, + "default": "fragment(\"(now() AT TIME ZONE 'utc')\")", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "inserted_at", + "type": "utc_datetime_usec" + }, + { + "allow_nil?": false, + "default": "fragment(\"(now() AT TIME ZONE 'utc')\")", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "updated_at", + "type": "utc_datetime_usec" + }, + { + "allow_nil?": true, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": { + "deferrable": false, + "destination_attribute": "id", + "destination_attribute_default": null, + "destination_attribute_generated": null, + "index?": false, + "match_type": null, + "match_with": null, + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "name": "author_alias_registries_dbi_server_id_fkey", + "on_delete": null, + "on_update": null, + "primary_key?": true, + "schema": "public", + "table": "dbi_servers" + }, + "size": null, + "source": "dbi_server_id", + "type": "uuid" + } + ], + "base_filter": null, + "check_constraints": [], + "custom_indexes": [], + "custom_statements": [], + "has_create_action": true, + "hash": "492C5CA5764F4F67991D3D7F4C7F37FFD21A7DB5D7FDDB7FBC1E569D03646895", + "identities": [], + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "repo": "Elixir.DecentralisedBookIndex.Repo", + "schema": null, + "table": "author_alias_registries" +} \ No newline at end of file diff --git a/priv/resource_snapshots/repo/author_role/20250323094317.json b/priv/resource_snapshots/repo/author_role/20250323094317.json new file mode 100644 index 0000000..48fa45d --- /dev/null +++ b/priv/resource_snapshots/repo/author_role/20250323094317.json @@ -0,0 +1,156 @@ +{ + "attributes": [ + { + "allow_nil?": false, + "default": "fragment(\"gen_random_uuid()\")", + "generated?": false, + "primary_key?": true, + "references": null, + "size": null, + "source": "id", + "type": "uuid" + }, + { + "allow_nil?": true, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "role", + "type": "text" + }, + { + "allow_nil?": false, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "order", + "type": "bigint" + }, + { + "allow_nil?": false, + "default": "fragment(\"(now() AT TIME ZONE 'utc')\")", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "inserted_at", + "type": "utc_datetime_usec" + }, + { + "allow_nil?": false, + "default": "fragment(\"(now() AT TIME ZONE 'utc')\")", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "updated_at", + "type": "utc_datetime_usec" + }, + { + "allow_nil?": true, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": { + "deferrable": false, + "destination_attribute": "id", + "destination_attribute_default": null, + "destination_attribute_generated": null, + "index?": false, + "match_type": null, + "match_with": null, + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "name": "author_role_dbi_server_id_fkey", + "on_delete": null, + "on_update": null, + "primary_key?": true, + "schema": "public", + "table": "dbi_servers" + }, + "size": null, + "source": "dbi_server_id", + "type": "uuid" + }, + { + "allow_nil?": true, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": { + "deferrable": false, + "destination_attribute": "id", + "destination_attribute_default": null, + "destination_attribute_generated": null, + "index?": false, + "match_type": null, + "match_with": null, + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "name": "author_role_book_id_fkey", + "on_delete": null, + "on_update": null, + "primary_key?": true, + "schema": "public", + "table": "books" + }, + "size": null, + "source": "book_id", + "type": "uuid" + }, + { + "allow_nil?": true, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": { + "deferrable": false, + "destination_attribute": "id", + "destination_attribute_default": null, + "destination_attribute_generated": null, + "index?": false, + "match_type": null, + "match_with": null, + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "name": "author_role_author_id_fkey", + "on_delete": null, + "on_update": null, + "primary_key?": true, + "schema": "public", + "table": "authors" + }, + "size": null, + "source": "author_id", + "type": "uuid" + } + ], + "base_filter": null, + "check_constraints": [], + "custom_indexes": [], + "custom_statements": [], + "has_create_action": true, + "hash": "C7946A25C36A8CB07E68467BFDE0C0C5369C3895C36124422CA155E4EB054C16", + "identities": [], + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "repo": "Elixir.DecentralisedBookIndex.Repo", + "schema": null, + "table": "author_role" +} \ No newline at end of file diff --git a/priv/resource_snapshots/repo/authors/20250323094317.json b/priv/resource_snapshots/repo/authors/20250323094317.json new file mode 100644 index 0000000..920c9be --- /dev/null +++ b/priv/resource_snapshots/repo/authors/20250323094317.json @@ -0,0 +1,137 @@ +{ + "attributes": [ + { + "allow_nil?": false, + "default": "fragment(\"gen_random_uuid()\")", + "generated?": false, + "primary_key?": true, + "references": null, + "size": null, + "source": "id", + "type": "uuid" + }, + { + "allow_nil?": false, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "name", + "type": "text" + }, + { + "allow_nil?": false, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "description", + "type": "text" + }, + { + "allow_nil?": true, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "avatar_url", + "type": "text" + }, + { + "allow_nil?": false, + "default": "fragment(\"(now() AT TIME ZONE 'utc')\")", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "inserted_at", + "type": "utc_datetime_usec" + }, + { + "allow_nil?": false, + "default": "fragment(\"(now() AT TIME ZONE 'utc')\")", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "updated_at", + "type": "utc_datetime_usec" + }, + { + "allow_nil?": true, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": { + "deferrable": false, + "destination_attribute": "id", + "destination_attribute_default": null, + "destination_attribute_generated": null, + "index?": false, + "match_type": null, + "match_with": null, + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "name": "authors_dbi_server_id_fkey", + "on_delete": null, + "on_update": null, + "primary_key?": true, + "schema": "public", + "table": "dbi_servers" + }, + "size": null, + "source": "dbi_server_id", + "type": "uuid" + }, + { + "allow_nil?": true, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": { + "deferrable": false, + "destination_attribute": "id", + "destination_attribute_default": null, + "destination_attribute_generated": null, + "index?": false, + "match_type": null, + "match_with": null, + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "name": "authors_author_alias_registry_id_fkey", + "on_delete": null, + "on_update": null, + "primary_key?": true, + "schema": "public", + "table": "author_alias_registries" + }, + "size": null, + "source": "author_alias_registry_id", + "type": "uuid" + } + ], + "base_filter": null, + "check_constraints": [], + "custom_indexes": [], + "custom_statements": [], + "has_create_action": true, + "hash": "B16E7D36D4B6989B17D17DE8554C1B0AC13CFC31D7074163CA236F0692565C95", + "identities": [], + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "repo": "Elixir.DecentralisedBookIndex.Repo", + "schema": null, + "table": "authors" +} \ No newline at end of file diff --git a/priv/resource_snapshots/repo/book_editions_registries/20250323094317.json b/priv/resource_snapshots/repo/book_editions_registries/20250323094317.json new file mode 100644 index 0000000..15e7722 --- /dev/null +++ b/priv/resource_snapshots/repo/book_editions_registries/20250323094317.json @@ -0,0 +1,78 @@ +{ + "attributes": [ + { + "allow_nil?": false, + "default": "fragment(\"gen_random_uuid()\")", + "generated?": false, + "primary_key?": true, + "references": null, + "size": null, + "source": "id", + "type": "uuid" + }, + { + "allow_nil?": false, + "default": "fragment(\"(now() AT TIME ZONE 'utc')\")", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "inserted_at", + "type": "utc_datetime_usec" + }, + { + "allow_nil?": false, + "default": "fragment(\"(now() AT TIME ZONE 'utc')\")", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "updated_at", + "type": "utc_datetime_usec" + }, + { + "allow_nil?": true, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": { + "deferrable": false, + "destination_attribute": "id", + "destination_attribute_default": null, + "destination_attribute_generated": null, + "index?": false, + "match_type": null, + "match_with": null, + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "name": "book_editions_registries_dbi_server_id_fkey", + "on_delete": null, + "on_update": null, + "primary_key?": true, + "schema": "public", + "table": "dbi_servers" + }, + "size": null, + "source": "dbi_server_id", + "type": "uuid" + } + ], + "base_filter": null, + "check_constraints": [], + "custom_indexes": [], + "custom_statements": [], + "has_create_action": true, + "hash": "9D6D072AA33C51A70415A4C52023811B75A890D6E199786AE992629C47AFE803", + "identities": [], + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "repo": "Elixir.DecentralisedBookIndex.Repo", + "schema": null, + "table": "book_editions_registries" +} \ No newline at end of file diff --git a/priv/resource_snapshots/repo/book_ids/20250323094317.json b/priv/resource_snapshots/repo/book_ids/20250323094317.json new file mode 100644 index 0000000..f0842fd --- /dev/null +++ b/priv/resource_snapshots/repo/book_ids/20250323094317.json @@ -0,0 +1,137 @@ +{ + "attributes": [ + { + "allow_nil?": false, + "default": "fragment(\"gen_random_uuid()\")", + "generated?": false, + "primary_key?": true, + "references": null, + "size": null, + "source": "id", + "type": "uuid" + }, + { + "allow_nil?": false, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "type", + "type": "text" + }, + { + "allow_nil?": false, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "bid", + "type": "text" + }, + { + "allow_nil?": false, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "order", + "type": "bigint" + }, + { + "allow_nil?": false, + "default": "fragment(\"(now() AT TIME ZONE 'utc')\")", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "inserted_at", + "type": "utc_datetime_usec" + }, + { + "allow_nil?": false, + "default": "fragment(\"(now() AT TIME ZONE 'utc')\")", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "updated_at", + "type": "utc_datetime_usec" + }, + { + "allow_nil?": true, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": { + "deferrable": false, + "destination_attribute": "id", + "destination_attribute_default": null, + "destination_attribute_generated": null, + "index?": false, + "match_type": null, + "match_with": null, + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "name": "book_ids_dbi_server_id_fkey", + "on_delete": null, + "on_update": null, + "primary_key?": true, + "schema": "public", + "table": "dbi_servers" + }, + "size": null, + "source": "dbi_server_id", + "type": "uuid" + }, + { + "allow_nil?": true, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": { + "deferrable": false, + "destination_attribute": "id", + "destination_attribute_default": null, + "destination_attribute_generated": null, + "index?": true, + "match_type": null, + "match_with": null, + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "name": "book_ids_book_id_fkey", + "on_delete": "delete", + "on_update": null, + "primary_key?": true, + "schema": "public", + "table": "books" + }, + "size": null, + "source": "book_id", + "type": "uuid" + } + ], + "base_filter": null, + "check_constraints": [], + "custom_indexes": [], + "custom_statements": [], + "has_create_action": true, + "hash": "7E20C8AA3378E3CDB3216682ABFA0D36A8FFC103623A9F8D0AF38AEE5C73B004", + "identities": [], + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "repo": "Elixir.DecentralisedBookIndex.Repo", + "schema": null, + "table": "book_ids" +} \ No newline at end of file diff --git a/priv/resource_snapshots/repo/books/20250323094318.json b/priv/resource_snapshots/repo/books/20250323094318.json new file mode 100644 index 0000000..38edb94 --- /dev/null +++ b/priv/resource_snapshots/repo/books/20250323094318.json @@ -0,0 +1,206 @@ +{ + "attributes": [ + { + "allow_nil?": false, + "default": "fragment(\"gen_random_uuid()\")", + "generated?": false, + "primary_key?": true, + "references": null, + "size": null, + "source": "id", + "type": "uuid" + }, + { + "allow_nil?": false, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "title", + "type": "text" + }, + { + "allow_nil?": false, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "description", + "type": "text" + }, + { + "allow_nil?": false, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "published", + "type": "date" + }, + { + "allow_nil?": false, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "language", + "type": "text" + }, + { + "allow_nil?": false, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "format", + "type": "text" + }, + { + "allow_nil?": false, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "page_count", + "type": "bigint" + }, + { + "allow_nil?": true, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "cover_image_url", + "type": "text" + }, + { + "allow_nil?": false, + "default": "fragment(\"(now() AT TIME ZONE 'utc')\")", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "inserted_at", + "type": "utc_datetime_usec" + }, + { + "allow_nil?": false, + "default": "fragment(\"(now() AT TIME ZONE 'utc')\")", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "updated_at", + "type": "utc_datetime_usec" + }, + { + "allow_nil?": true, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": { + "deferrable": false, + "destination_attribute": "id", + "destination_attribute_default": null, + "destination_attribute_generated": null, + "index?": false, + "match_type": null, + "match_with": null, + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "name": "books_dbi_server_id_fkey", + "on_delete": null, + "on_update": null, + "primary_key?": true, + "schema": "public", + "table": "dbi_servers" + }, + "size": null, + "source": "dbi_server_id", + "type": "uuid" + }, + { + "allow_nil?": true, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": { + "deferrable": false, + "destination_attribute": "id", + "destination_attribute_default": null, + "destination_attribute_generated": null, + "index?": false, + "match_type": null, + "match_with": null, + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "name": "books_book_editions_registry_id_fkey", + "on_delete": null, + "on_update": null, + "primary_key?": true, + "schema": "public", + "table": "book_editions_registries" + }, + "size": null, + "source": "book_editions_registry_id", + "type": "uuid" + }, + { + "allow_nil?": true, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": { + "deferrable": false, + "destination_attribute": "id", + "destination_attribute_default": null, + "destination_attribute_generated": null, + "index?": false, + "match_type": null, + "match_with": null, + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "name": "books_publisher_id_fkey", + "on_delete": null, + "on_update": null, + "primary_key?": true, + "schema": "public", + "table": "publishers" + }, + "size": null, + "source": "publisher_id", + "type": "uuid" + } + ], + "base_filter": null, + "check_constraints": [], + "custom_indexes": [], + "custom_statements": [], + "has_create_action": true, + "hash": "D601FB56FC14AD0981B5E4F40F683FF98E84E2103A26F007F932A41E63A0E41D", + "identities": [], + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "repo": "Elixir.DecentralisedBookIndex.Repo", + "schema": null, + "table": "books" +} \ No newline at end of file diff --git a/priv/resource_snapshots/repo/publishers/20250323094318.json b/priv/resource_snapshots/repo/publishers/20250323094318.json new file mode 100644 index 0000000..9990f2f --- /dev/null +++ b/priv/resource_snapshots/repo/publishers/20250323094318.json @@ -0,0 +1,88 @@ +{ + "attributes": [ + { + "allow_nil?": false, + "default": "fragment(\"gen_random_uuid()\")", + "generated?": false, + "primary_key?": true, + "references": null, + "size": null, + "source": "id", + "type": "uuid" + }, + { + "allow_nil?": false, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "name", + "type": "text" + }, + { + "allow_nil?": false, + "default": "fragment(\"(now() AT TIME ZONE 'utc')\")", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "inserted_at", + "type": "utc_datetime_usec" + }, + { + "allow_nil?": false, + "default": "fragment(\"(now() AT TIME ZONE 'utc')\")", + "generated?": false, + "primary_key?": false, + "references": null, + "size": null, + "source": "updated_at", + "type": "utc_datetime_usec" + }, + { + "allow_nil?": true, + "default": "nil", + "generated?": false, + "primary_key?": false, + "references": { + "deferrable": false, + "destination_attribute": "id", + "destination_attribute_default": null, + "destination_attribute_generated": null, + "index?": false, + "match_type": null, + "match_with": null, + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "name": "publishers_dbi_server_id_fkey", + "on_delete": null, + "on_update": null, + "primary_key?": true, + "schema": "public", + "table": "dbi_servers" + }, + "size": null, + "source": "dbi_server_id", + "type": "uuid" + } + ], + "base_filter": null, + "check_constraints": [], + "custom_indexes": [], + "custom_statements": [], + "has_create_action": true, + "hash": "8E1966B940E38A6C277C78F1825C7C03A2400AE4AEF7134DC1F67EC2190EC865", + "identities": [], + "multitenancy": { + "attribute": null, + "global": null, + "strategy": null + }, + "repo": "Elixir.DecentralisedBookIndex.Repo", + "schema": null, + "table": "publishers" +} \ No newline at end of file