port over some more

This commit is contained in:
ra
2026-02-14 23:58:01 -07:00
parent 0222be36c5
commit 61176cd416
107 changed files with 9124 additions and 375 deletions

View File

@@ -0,0 +1,25 @@
defmodule Odinsea.Database.Schema.MacBan do
@moduledoc """
Ecto schema for the macbans table.
Represents MAC address bans.
"""
use Ecto.Schema
import Ecto.Changeset
@primary_key {:macbanid, :id, autogenerate: true}
schema "macbans" do
field :mac, :string
end
@doc """
Changeset for creating a MAC ban.
"""
def changeset(mac_ban, attrs) do
mac_ban
|> cast(attrs, [:mac])
|> validate_required([:mac])
|> unique_constraint(:mac)
end
end