27 lines
661 B
Elixir
27 lines
661 B
Elixir
defmodule Odinsea.Database.Schema.CompensationLog do
|
|
@moduledoc """
|
|
Ecto schema for the compensationlog_confirmed table.
|
|
Represents compensation records for players.
|
|
"""
|
|
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
@primary_key {:chrname, :string, autogenerate: false}
|
|
|
|
schema "compensationlog_confirmed" do
|
|
field :donor, :integer, default: 0
|
|
field :value, :integer, default: 0
|
|
field :taken, :integer, default: 0
|
|
end
|
|
|
|
@doc """
|
|
Changeset for compensation log.
|
|
"""
|
|
def changeset(compensation_log, attrs) do
|
|
compensation_log
|
|
|> cast(attrs, [:chrname, :donor, :value, :taken])
|
|
|> validate_required([:chrname])
|
|
end
|
|
end
|