port over some more
This commit is contained in:
26
lib/odinsea/database/schema/compensation_log.ex
Normal file
26
lib/odinsea/database/schema/compensation_log.ex
Normal file
@@ -0,0 +1,26 @@
|
||||
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
|
||||
Reference in New Issue
Block a user