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,31 @@
defmodule Odinsea.Database.Schema.SavedLocation do
@moduledoc """
Ecto schema for the savedlocations table.
Represents saved locations for characters (teleport rocks, etc).
"""
use Ecto.Schema
import Ecto.Changeset
@primary_key {:id, :id, autogenerate: true}
schema "savedlocations" do
field :characterid, :integer
field :locationtype, :integer, default: 0
field :map, :integer
belongs_to :character, Odinsea.Database.Schema.Character,
foreign_key: :characterid,
references: :id,
define_field: false
end
@doc """
Changeset for creating/updating a saved location.
"""
def changeset(saved_location, attrs) do
saved_location
|> cast(attrs, [:characterid, :locationtype, :map])
|> validate_required([:characterid, :map])
end
end