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,28 @@
defmodule Odinsea.Database.Schema.Speedrun do
@moduledoc """
Ecto schema for the speedruns table.
Represents dungeon speedrun records.
"""
use Ecto.Schema
import Ecto.Changeset
@primary_key {:id, :id, autogenerate: true}
schema "speedruns" do
field :type, :string
field :leader, :string
field :timestring, :string
field :time, :integer, default: 0
field :members, :string, default: ""
end
@doc """
Changeset for creating a speedrun record.
"""
def changeset(speedrun, attrs) do
speedrun
|> cast(attrs, [:type, :leader, :timestring, :time, :members])
|> validate_required([:type, :leader, :timestring])
end
end