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,26 @@
defmodule Odinsea.Database.Schema.Android do
@moduledoc """
Ecto schema for the androids table.
Represents android companion data.
"""
use Ecto.Schema
import Ecto.Changeset
@primary_key {:uniqueid, :id, autogenerate: true}
schema "androids" do
field :name, :string, default: "Android"
field :hair, :integer, default: 0
field :face, :integer, default: 0
end
@doc """
Changeset for creating/updating an android.
"""
def changeset(android, attrs) do
android
|> cast(attrs, [:name, :hair, :face])
|> validate_required([:name])
end
end