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,37 @@
defmodule Odinsea.Database.Schema.ScrollLog do
@moduledoc """
Ecto schema for the scroll_log table.
Represents scroll usage logs.
"""
use Ecto.Schema
import Ecto.Changeset
@primary_key {:id, :id, autogenerate: true}
schema "scroll_log" do
field :acc_id, :integer, default: 0, source: :accId
field :chr_id, :integer, default: 0, source: :chrId
field :scroll_id, :integer, default: 0, source: :scrollId
field :item_id, :integer, default: 0, source: :itemId
field :old_slots, :integer, default: 0, source: :oldSlots
field :new_slots, :integer, default: 0, source: :newSlots
field :hammer, :integer, default: 0
field :result, :string, default: ""
field :white_scroll, :integer, default: 0, source: :whiteScroll
field :legendary_spirit, :integer, default: 0, source: :legendarySpirit
field :vega_id, :integer, default: 0, source: :vegaId
end
@doc """
Changeset for creating a scroll log entry.
"""
def changeset(scroll_log, attrs) do
scroll_log
|> cast(attrs, [
:acc_id, :chr_id, :scroll_id, :item_id, :old_slots, :new_slots,
:hammer, :result, :white_scroll, :legendary_spirit, :vega_id
])
|> validate_required([:acc_id, :chr_id, :scroll_id, :item_id])
end
end