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,27 @@
defmodule Odinsea.Database.Schema.TournamentLog do
@moduledoc """
Ecto schema for the tournamentlog table.
Represents tournament records.
"""
use Ecto.Schema
import Ecto.Changeset
@primary_key {:logid, :id, autogenerate: true}
@timestamps_opts [inserted_at: :when, updated_at: false]
schema "tournamentlog" do
field :winnerid, :integer, default: 0
field :num_contestants, :integer, default: 0, source: :numContestants
field :when, :naive_datetime
end
@doc """
Changeset for creating a tournament log entry.
"""
def changeset(tournament_log, attrs) do
tournament_log
|> cast(attrs, [:winnerid, :num_contestants])
|> validate_required([:winnerid])
end
end