24 lines
435 B
Elixir
24 lines
435 B
Elixir
defmodule Odinsea.Database.Schema.Shop do
|
|
@moduledoc """
|
|
Ecto schema for the shops table.
|
|
Represents NPC shop definitions.
|
|
"""
|
|
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
@primary_key {:shopid, :id, autogenerate: true}
|
|
|
|
schema "shops" do
|
|
field :npcid, :integer, default: 0
|
|
end
|
|
|
|
@doc """
|
|
Changeset for creating/updating a shop.
|
|
"""
|
|
def changeset(shop, attrs) do
|
|
shop
|
|
|> cast(attrs, [:npcid])
|
|
end
|
|
end
|