defmodule GitGud.Federation.InstanceAllowlist do
use Ecto.Schema
import Ecto.Changeset
schema "fed_instance_allowlist" do
field :host, :string
field :note, :string
timestamps(type: :utc_datetime, updated_at: false)
end
def changeset(a, attrs) do
a
|> cast(attrs, [:host, :note])
|> validate_required([:host])
|> validate_length(:host, max: 250)
|> unique_constraint(:host)
end
end
428 B · text
5af55d9