From 4cb3b702e88bd5265b9bab0ca8d97c15b2f389f4 Mon Sep 17 00:00:00 2001 From: miraikumiko Date: Wed, 18 Jun 2025 16:17:54 +0200 Subject: [PATCH] Update actor --- lib/nulla/models/actor.ex | 21 ++++++------------- .../20250615130714_create_actors.exs | 8 +++---- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/lib/nulla/models/actor.ex b/lib/nulla/models/actor.ex index 8db516e..f1c58a1 100644 --- a/lib/nulla/models/actor.ex +++ b/lib/nulla/models/actor.ex @@ -25,12 +25,12 @@ defmodule Nulla.Models.Actor do field :indexable, :boolean, default: true field :published, :utc_datetime field :memorial, :boolean, default: false - field :publicKey, {:array, :map} - field :tag, {:array, :map} - field :attachment, {:array, :map} + field :publicKey, :map + field :tag, {:array, :map}, default: [] + field :attachment, {:array, :map}, default: [] field :endpoints, :map - field :icon, :map - field :image, :map + field :icon, :map, default: %{} + field :image, :map, default: %{} field :vcard_bday, :date field :vcard_Address, :string @@ -71,7 +71,6 @@ defmodule Nulla.Models.Actor do :vcard_Address ]) |> validate_required([ - :id, :domain, :ap_id, :type, @@ -82,8 +81,6 @@ defmodule Nulla.Models.Actor do :featured, :featuredTags, :preferredUsername, - :name, - :summary, :url, :manuallyApprovesFollowers, :discoverable, @@ -91,13 +88,7 @@ defmodule Nulla.Models.Actor do :published, :memorial, :publicKey, - :tag, - :attachment, - :endpoints, - :icon, - :image, - :vcard_bday, - :vcard_Address + :endpoints ]) end diff --git a/priv/repo/migrations/20250615130714_create_actors.exs b/priv/repo/migrations/20250615130714_create_actors.exs index d94ca47..da2ff37 100644 --- a/priv/repo/migrations/20250615130714_create_actors.exs +++ b/priv/repo/migrations/20250615130714_create_actors.exs @@ -23,11 +23,11 @@ defmodule Nulla.Repo.Migrations.CreateActors do add :published, :utc_datetime add :memorial, :boolean, default: false add :publicKey, :map - add :tag, {:array, :map} - add :attachment, {:array, :map} + add :tag, {:array, :map}, default: [] + add :attachment, {:array, :map}, default: [] add :endpoints, :map - add :icon, :map - add :image, :map + add :icon, :map, default: %{} + add :image, :map, default: %{} add :vcard_bday, :date add :vcard_Address, :string end