Files
odinsea-elixir/lib/odinsea/database/schema/gm_log.ex
2026-02-14 23:58:01 -07:00

29 lines
657 B
Elixir

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