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.GmLog do
@moduledoc """
Ecto schema for the gmlog table.
Represents GM command usage logs.
"""
use Ecto.Schema
import Ecto.Changeset
@primary_key {:gmlogid, :id, autogenerate: true}
@timestamps_opts [inserted_at: :time, updated_at: false]
schema "gmlog" do
field :cid, :integer, default: 0
field :command, :string
field :mapid, :integer, default: 0
field :time, :naive_datetime
end
@doc """
Changeset for creating a GM log entry.
"""
def changeset(gm_log, attrs) do
gm_log
|> cast(attrs, [:cid, :command, :mapid])
|> validate_required([:cid, :command])
end
end