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.BattleLog do
@moduledoc """
Ecto schema for the battlelog table.
Represents PvP battle records between accounts.
"""
use Ecto.Schema
import Ecto.Changeset
@primary_key {:battlelogid, :id, autogenerate: true}
@timestamps_opts [inserted_at: :when, updated_at: false]
schema "battlelog" do
field :accid, :integer, default: 0
field :accid_to, :integer, default: 0
field :when, :naive_datetime
end
@doc """
Changeset for creating a battle log entry.
"""
def changeset(battle_log, attrs) do
battle_log
|> cast(attrs, [:accid, :accid_to])
|> validate_required([:accid, :accid_to])
end
end