diff --git a/lib/pinchflat/sources/source.ex b/lib/pinchflat/sources/source.ex index 99ff2d4..38da139 100644 --- a/lib/pinchflat/sources/source.ex +++ b/lib/pinchflat/sources/source.ex @@ -15,6 +15,7 @@ defmodule Pinchflat.Sources.Source do alias Pinchflat.Metadata.SourceMetadata @allowed_fields ~w( + enabled collection_name collection_id collection_type @@ -64,6 +65,7 @@ defmodule Pinchflat.Sources.Source do )a schema "sources" do + field :enabled, :boolean, default: true # This is _not_ used as the primary key or internally in the database # relations. This is only used to prevent an enumeration attack on the streaming # and RSS feed endpoints since those _must_ be public (ie: no basic auth) diff --git a/lib/pinchflat_web/controllers/sources/source_html/index_table_live.ex b/lib/pinchflat_web/controllers/sources/source_html/index_table_live.ex index 47b5e69..434cbb7 100644 --- a/lib/pinchflat_web/controllers/sources/source_html/index_table_live.ex +++ b/lib/pinchflat_web/controllers/sources/source_html/index_table_live.ex @@ -7,6 +7,7 @@ defmodule PinchflatWeb.Sources.IndexTableLive do alias Pinchflat.Sources.Source alias Pinchflat.Media.MediaItem + # TODO: test def render(assigns) do ~H""" <.table rows={@sources} table_class="text-black dark:text-white"> diff --git a/priv/repo/erd.png b/priv/repo/erd.png index c6566d8..6237757 100644 Binary files a/priv/repo/erd.png and b/priv/repo/erd.png differ diff --git a/priv/repo/migrations/20241120204407_add_enabled_to_sources.exs b/priv/repo/migrations/20241120204407_add_enabled_to_sources.exs new file mode 100644 index 0000000..e98150b --- /dev/null +++ b/priv/repo/migrations/20241120204407_add_enabled_to_sources.exs @@ -0,0 +1,9 @@ +defmodule Pinchflat.Repo.Migrations.AddEnabledToSources do + use Ecto.Migration + + def change do + alter table(:sources) do + add :enabled, :boolean, default: true, null: false + end + end +end